hi George,
George Patterson wrote:
> Sort of. I still have a problem where aiko_gateway code stops running.
The process stops (check via "ps ax | grep aiko_gateway") ?
Or, does just some aspect of the functionality stop working and the
process continues ?
> The best I was able to do last night is the following:-
>
> I would have though that we would be logging more than once every 30
> hour or so. :-)
Logging to SEG is meant to be every 10 seconds (at most) ... and better
if it is longer, e.g 5 or 15 minutes.
Currently, the display refresh rate and the transmission time (logging
over the serial port) are the same value ...
aiko_node.pde: Line 62: #define TRANSMIT_PERIOD 1 // seconds
This is fine for standalone operation of a Pebble or the Arduino running
Aiko-Node inside the Aiko-Gateway.
However, when attempting a connect all the way through to SEG, you
should drop this value to be a minimum of 10 seconds.
aiko_node.pde: Line 62: #define TRANSMIT_PERIOD 10 // seconds
Try 10 seconds ... and see how you go.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Given that there are a number of different timing constraints in the
system, e.g. sensor sample rate, display refresh rate, local network
transmission rate (ZigBee, Ethernet, WiFi, Serial) and remote network
transmission rate (WAN, ADSL, Cable or 3G) ...
... there are a few different event loops that will need to evolve with
the whole system.
The framework including both Aiko-Gateway and Aiko-Node have this
capability built-in ... but, I haven't completely fleshed it out yet.
> The symptom is that aiko_gateway doesn't appear to be getting
> information from the serial socket to the aiko_gateway code. Should I
> assume that the message "ERROR: aiko_node_name is 'unregistered'" as
> shown below is okay?
Because the Aiko-Gateway can be receiving information from a number of
different Aiko-Nodes ... the gateway parses the header to determine
which node the message has come from (which ultimately allows the
gateway to determine how to send messages back to that node).
If the gateway sees a message without a "node name" or if the node
hasn't been configured with a node name ... then, you'll see the
"unregistered" message (which is not a good thing).
I think in your case it may be because the node is sending messages
every 1 second ... and the gateway isn't dealing with that properly.
Please reduce the TRANSMIT_PERIOD to be 10 seconds and see how it goes.
This aspect of the communications handling will be improved.
> I am getting the occasional data point being logged but appears to be
> inconsistent. I'm sure that the problem is at my end.
I think that is consistent with my description above.
> root@zen_gateway:~# -- send_message(): start
> Aiko status: timeout
The "timeout" message is normal (perhaps I should make it sound less
onerous) ... and simply means that the aiko_gateway.lua co-routine for
serial communications handling hasn't seen any serial data in the last 5
seconds, and it will "yield" the CPU to another available co-routine.
> -- read_message(): start
> -- read_message(): node_name: zen_01
Okay, this is an example where the "node name" has been read and parsed
okay.
> -- coroutine.resume(coroutine_serial):
> Aiko status: closed
Okay, that's a problem :(
This means that the serial handler has detected that the "Ser2Net socket
on port 2000" (which reflects the serial communications port) has closed
for some reason.
> -- read_message(): start
> -- read_message(): ERROR: aiko_node_name is 'unregistered'
When the aiko_gateway.lua process starts, it assumes that the node is
unregistered, until it receives a message from the node, stating what
its name is.
If a message is received prior to receiving the Aiko-Node node name, the
you'll see the above message 'unregistered' and the message will be ignored.
> -- read_message(): end
> Aiko status: timeout
> -- read_message(): start
> -- read_message(): node_name: zen_01
And, now the next message the Aiko-Gateway (router) received from the
Aiko-Node (Arduino) was the node name ... and everything should be good
from here.
Sam Sabey wrote:
> I have however observed on my gateways that when the current
> aiko_gateway has some serial problem it tends to cease operation.
> I understand this will be rectified in a future version of
> aiko_gateway.
Yes, that's right :( And now that we're starting to adjust focus from
getting the hardware complete to getting the software solid ... these
issues will be resolved.