(The Pi sends back a json reply containing temperatures, battery info and so on.)
This works OK, but when I run it I get regular timeout errors on my security alarm comms (different plug-in) which uses luup.io.write and raw protocol, with Vera sending me incoming bytes. This works flawlessly, with no retries at all unless the emoncms comms are running. There’s nothing suspicious in the LuaUPnP log.
Am I missing something? If so, pointers appreciated!
Update: Problem occurs when both plug-ins send a message at the same time. Despite the fact that they are sending in different ways, to different URLs and using different ports, it seems that if messages are sent from the plug-ins at the same time Vera just stops responding to incoming data for periods between a few seconds and two minutes or so.
I am not surprised … LUA was not originally designed for multi-thread applications. Originally it was single thread with co-routines. There is likely some shared resource that is getting clobbered at the socket level that is causing the problem.
This will probably need a ticket raised to MCV to get resolved … I have not come across any of the details on the approach that MCV uses to host the LUA environment in a thread with it’s own LUA environment per device.
racarter, how do you respond to the luup.inet.wget on the Raspberry? I am trying to do something similar with an Arduino and know they are different, but it might give me a clue.
Actually, I was referring to how to get the raspberry to respond propperly to the wget. What do you do on the raspberry for formating. That sort of thing.
The Pi is running an emoncms data logger, logging temperatures into an SQL database and providing a web interface via an Apache server. My Vera plug-in asks the Pi for the data in .json format. I just installed the logger on the Pi - I didn’t write it.
I agree with Richard that this deserves a trouble ticket to MCV, because socket I/O in one plugin ought to have no side effects on socket I/O in other plugins (assuming no plugin is “abusing” the APIs with excessive polling or resource consumption, which it doesn’t sound like you are doing).
watou - The emoncms plug-in polls once per minute. The Texecom security alarm plug-in polls once every couple of seconds but works perfectly when the emoncms plug-in is not polling, so I don’t think I’m making unreasonable demands on the socket I/O.
I raised a ticket in March but have heard nothing since.
In the meantime I’ve got round the problem by modifying the Texecom plug-in to avoid polling for the first five seconds in each new minute, and arranging for the emoncms plug-in to poll only during that window.
Best Home Automation shopping experience. Shop at Ezlo!