raspberrypi_run.php problems

I'm no expert on php, and I see there is some discussion about moving away from php and using something else, but it appears to me that the script /var/www/emoncms/Modules/raspberrypi/raspberrypi_run.php makes dangerous assumptions, i.e. it assumes the data coming from emonTX are 16bit integers.

Is there some jiggery pokery that emoncms can do to combine 16 bit numbers into an unsigned long, but then what about floats ?

Is anyone working on fixing this ?

I've not looked at any other gateway code just the Raspberry Pi php stuff.

Mike

TrystanLea's picture

Re: raspberrypi_run.php problems

Hello Mike

Raspberrypi_run.php assumes 16bit numbers for a good reason, its because we've currently standardized on data being sent from nodes as a series of integers defined in the scruct statement at the top of the emontx firmware examples.

It has been discussed though to have the option on the raspberrypi to decode the data send from the rfm12pi board in any number of different ways, a series of integers being just one of them, you could have an option in the raspberrypi module gui to say decode data from node A following one structure and nodeB following a different structure. 

Structure info is not in the radio packet as this would require a considerably larger message length, although ideas for this have been discussed by jeelabs and others.

php and python gateway implement the above in the same way.

Trystan

nothing clever's picture

Re: raspberrypi_run.php problems

Thanks for the reply.

I wondered about this because my generation meter is an Elster A100C. The emonTX example for the Elster A100C gets a feedback call with an unsigned long being potentally a 10 digit number (some hope that should I ever generate that much), If that meter reading is then passed back to the base station, then the code never cope.

I've not built the IrDa interface - not even got the necessary components, I was just thinking ahead about how the code has to change if I did pass that info about.

Thanks for the background info.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.