Aiko gateway change

5 views
Skip to first unread message

George Patterson

unread,
Nov 17, 2009, 10:35:35 AM11/17/09
to aiko-platform
Hi All,

For those that might be reflashing your Aiko node code from Andy's
latest aiko_node code (dated 17th November), you will also need to
edit the speed in the file /etc/ser2net.conf from

2000:raw:0:/dev/tts/0:115200
to
2000:raw:0:/dev/tts/0:38400

Otherwise you will see gibberish rather than the nice SExpressions
from the Arduino.

Now to figure out why this thing isn't logging to SEG but that's for
another day.

Regards


George

Sam Sabey

unread,
Nov 17, 2009, 7:07:12 PM11/17/09
to aiko-p...@googlegroups.com
Hey George,

Looks like you solved it!  I can see you were online from 12:08 through to the last point at 02:45am this morning.

Do you know what the problem may have been?

Sam.
Hi All,

For those that might be reflashing your Aiko node code from Andy's
latest aiko_node code (dated 17th November), you will also need to
edit the speed in the file /etc/ser2net.conf from

2000:raw:0:/dev/tts/0:115200
to
2000:raw:0:/dev/tts/0:38400

Otherwise you will see gibberish rather than the nice SExpressions
from the Arduino.

Now to figure out why this thing isn't logging to SEG but that's for
another day.

Regards


George

--

You received this message because you are subscribed to the Google Groups "Aiko distributed platform" group.
To post to this group, send email to aiko-p...@googlegroups.com.
To unsubscribe from this group, send email to aiko-platfor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/aiko-platform?hl=.


George Patterson

unread,
Nov 17, 2009, 7:44:53 PM11/17/09
to aiko-platform
Hey Sam,

Sort of. I still have a problem where aiko_gateway code stops running. The best I was able to do last night is the following:-

Wed, 18 November 2009 02:23:39 633.0
Wed, 18 November 2009 01:52:54 625.0
Wed, 18 November 2009 01:37:45 613.0
Wed, 18 November 2009 01:05:16 523.0
Wed, 18 November 2009 01:05:16 311.0
Wed, 18 November 2009 00:40:01 385.0

I would have though that we would be logging more than once every 30 hour or so. :-)

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?

I am getting the occasional data point being logged but appears to be inconsistent. I'm sure that the problem is at my end.

root@zen_gateway:~# -- send_message(): start
Aiko status:      timeout
-- read_message(): start
-- read_message(): node_name: zen_01
-- read_message(): end
-- coroutine.resume(coroutine_serial):
-- send_message(): end
-- send_event_heartbeat(): zen_gateway
-- send_message(): start
-- send_message(): end
-- coroutine.resume(coroutine_serial):
Aiko status:      closed
-- read_message(): start
-- read_message(): ERROR: aiko_node_name is 'unregistered'
-- read_message(): end
Aiko status:      timeout
-- read_message(): start
-- read_message(): node_name: zen_01
-- read_message(): end
etc

Regards


George


2009/11/18 Sam Sabey <sam....@esskware.com.au>

Andy Gelme

unread,
Nov 17, 2009, 7:46:42 PM11/17/09
to aiko-p...@googlegroups.com
hi All,

Thanks George.

George Patterson wrote:
> For those that might be reflashing your Aiko node code from Andy's
> latest aiko_node code (dated 17th November), you will also need to
> edit the speed in the file /etc/ser2net.conf from
>
> 2000:raw:0:/dev/tts/0:115200
> to
> 2000:raw:0:/dev/tts/0:38400

For various reasons, I've changed the Aiko-Node default serial port
speed to be 38,400 baud.

For example, Digi ZigBee Series 1 modules don't seem to perform well at
115,200 baud (I think that this is related to an issue that Sam and I
have seen from time-to-time with his ZigBee modules). A number of other
devices don't work well at higher speeds. And, there are limitations to
what can be realistically done with NewSoftwareSerial and ZigBee
networks in general.

I notice that Jon Oxer came to a similar conclusion for different, but
related reasons ... some time ago ... and he uses 38,400 baud as his
default.

At some stage, I'm thinking that Aiko-Node should default to 38,400 baud
and perform auto-baud negotiation to determine whether a higher speed,
e.g. 115,200 baud, is desired between both parties.

Once there is a proper released version of the Aiko-Gateway (along with
the configuration files), it will be updated to be in step with the
current Aiko-Node code.

> Now to figure out why this thing isn't logging to SEG but that's for
> another day.

Whatever is causing that problem ... won't be due to the baud rate
change between Aiko-Gateway and Aiko-Node.

--
-O- cheers = /\ /\/ /) `/ =
--O -- http://www.geekscape.org --
OOO -- an...@geekscape.org -- http://twitter.com/geekscape --

Sam Sabey

unread,
Nov 17, 2009, 7:55:21 PM11/17/09
to aiko-p...@googlegroups.com
I'm note sure what the problem could be.  I logged a bunch of successful transactions on the web server for those that came from your last ip address that is.

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.

Andy Gelme

unread,
Nov 17, 2009, 8:51:58 PM11/17/09
to aiko-p...@googlegroups.com
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.

George Patterson

unread,
Nov 17, 2009, 10:07:40 PM11/17/09
to aiko-platform
2009/11/18 Andy Gelme <an...@geekscape.org>:
> 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") ?
>

I meant stops as in dies or exits.

> 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.
>

10 (seconds) works much better. Thanks. I'll drop the Transmit period
down a bit more tonight. Also thanks for the explanation of the
aiko_gateway messages.

Regards


George
Reply all
Reply to author
Forward
0 new messages