RunParseResults

bowlingbeeg's Avatar Topic Author
User User
  • Posts: 248
  • Thanks: 33

RunParseResults

2 years 5 months ago
#2141
Does RunParseResults only parse JSON data?  I'm trying to get status from the Lumagen and I get data back like this

!I24,0,000,0000,0,0,178,220,-,0,000e,0,0,059,1080,178,1,0,n,P,07,04,178,220

But I don't know of a good way to parse that once I have it in MyServer6.  I was hoping the RunParseResults would parse that into separate variables but it doesn't seem to do that.  Am I doing something wrong or is that just not supported?

Please Log in or Create an account to join the conversation.

davep's Avatar
Admin Admin
  • Posts: 371
  • Thanks: 98

Re: RunParseResults

2 years 5 months ago
#2150
The server has no knowledge of how to parse that response. How are you talking to your Lumagen now? Serial connection on the pi? GlobalCache iTach? I have plans to write the driver.

Please Log in or Create an account to join the conversation.

bowlingbeeg's Avatar Topic Author
User User
  • Posts: 248
  • Thanks: 33

Re: RunParseResults

2 years 5 months ago
#2154
Yeah I kind of figured. I was hoping it would magically split the comma separated values into variables.

I have the lumagen connected to the PI using the usb cable that came with the lumagen. The lumagen has a usb->serial connection built into the unit. So I wrote a python script that will take a command as input send it to the lumagen over the /dev/ttyUSB0 and then it will print out the result. I had tried to use the serial driver but I couldn't ever get that to work and never got a response from Allonis so I'm not sure why that didn't work( allonis.com/forum/generic-serial-driver/...-serial-driver-error ).

Please Log in or Create an account to join the conversation.

andrew's Avatar
User User
  • Posts: 341
  • Thanks: 28

Re: RunParseResults

2 years 5 months ago
#2156
Yeah I kind of figured. I was hoping it would magically split the comma separated values into variables.

I have the lumagen connected to the PI using the usb cable that came with the lumagen. The lumagen has a usb->serial connection built into the unit. So I wrote a python script that will take a command as input send it to the lumagen over the /dev/ttyUSB0 and then it will print out the result. I had tried to use the serial driver but I couldn't ever get that to work and never got a response from Allonis so I'm not sure why that didn't work( allonis.com/forum/generic-serial-driver/...-serial-driver-error ).
Change your python script to output the result as json? All you'd have to do is split on the commas in the string and print out {'res1": "I24", "res2": "0", ...} instead.

Andrew

Please Log in or Create an account to join the conversation.

bowlingbeeg's Avatar Topic Author
User User
  • Posts: 248
  • Thanks: 33

Re: RunParseResults

2 years 5 months ago
#2158
Yeah that was my plan but I wanted to see if maybe it could happen automatically with the RunParseResults command.

Please Log in or Create an account to join the conversation.

Time to create page: 0.308 seconds