RunParseResults

More
2 years 4 months ago #2141 by bowlingbeeg
RunParseResults was created by bowlingbeeg
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 to join the conversation.

More
2 years 4 months ago #2150 by davep
Replied by davep on topic RunParseResults
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 to join the conversation.

More
2 years 4 months ago #2154 by bowlingbeeg
Replied by bowlingbeeg on topic RunParseResults
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 to join the conversation.

More
2 years 4 months ago #2156 by andrew
Replied by andrew on topic RunParseResults

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 to join the conversation.

More
2 years 4 months ago #2158 by bowlingbeeg
Replied by bowlingbeeg on topic RunParseResults
Yeah that was my plan but I wanted to see if maybe it could happen automatically with the RunParseResults command.

Please Log in to join the conversation.

Time to create page: 0.184 seconds