LowPowerLab Forum

Software support => Pi Gateway => Topic started by: Kilo95 on September 22, 2017, 03:39:38 PM

Title: No nodes show after update to Jessie and Gateway v8.10 [solved]
Post by: Kilo95 on September 22, 2017, 03:39:38 PM
I just updated with a fresh image and then went through the script and get the gateway dashboard to pull up. I have changed all my passwords and port to /ttyUSB0 since I use the USB port. I've got a Sonarmote and two Weathershields and neither show up in the dashboard after this. i have rebooted after changes. any suggestions? I checked the gateway.sys.log and it only shows an inital error for the /ttyAMA0. I have changed to /ttyUSB0 and rebooted and no error there.
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Felix on September 22, 2017, 03:46:57 PM
Did this setup work before?
You have to debug the data coming from the motes into your gateway and make sure:

1) the serial port is receiving it
You can use minicom, install it this way:
sudo apt-get install minicom
Run it on your USB port
minicom -b 19200 -o -D /dev/ttyUSB0
2) the serial data is in a format that matches a metric definition (default sketches should generate such tokens)
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Kilo95 on September 22, 2017, 03:57:09 PM
i'm just getting gibberish in minicom. no serial data like it usually does
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Felix on September 22, 2017, 04:00:04 PM
Oops the baud is supposed to be 19200 not 9600.
Make sure your MoteinoUSB is programmed at 19200 baud as well, that's the default, or make it match the setting in the Gateway software.
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Kilo95 on September 22, 2017, 04:10:20 PM
still just gibberish:
ÿþÿÿÿÿàê~ÿþþþÿþàkþÿÿÿÿþÿÿÿÿÿÿþáÿk~ÿ

I was thinking of reuploading the PiGateway sketch. i'll give that a try
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Kilo95 on September 22, 2017, 04:14:11 PM
i plugged my gateway moteino into my PC and turned the serial monitor on and it works fine.
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: sparky on September 22, 2017, 04:56:39 PM
Had the same issue with no Motes showing up when I installed the new version (8.10).  Went back to 8.9  :P
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Kilo95 on September 22, 2017, 05:05:59 PM
I don't have 8.9 to use. I'm sure Felix can help me figure it out
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Kilo95 on September 22, 2017, 09:16:22 PM
this is what is in gateway.sys.log:

[09-23-17_00:19:30.329] [INFO]  AUTHORIZING CONNECTION FROM ::1:42552
[09-23-17_00:19:30.336] [INFO]  NEW CONNECTION FROM 192.168.1.235
[09-23-17_00:20:58.069] [INFO]  LOADING USER METRICS...
[09-23-17_00:20:58.112] [INFO]  LOADING USER METRICS MODULE [_example.js]
[09-23-17_00:21:00.218] [INFO]  AUTHORIZING CONNECTION FROM ::1:35582
[09-23-17_00:21:00.250] [INFO]  NEW CONNECTION FROM 192.168.1.235
[09-23-17_00:21:53.167] [INFO]  AUTHORIZING CONNECTION FROM ::1:35592
[09-23-17_00:21:53.173] [INFO]  NEW CONNECTION FROM 192.168.1.235

where it says "loading user metrics module" it says _example.js. Shouldn't that be metrics.js or am i wrong?
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: HeneryH on September 24, 2017, 09:00:23 AM
With the Jessie version, it seems like the serial port enable setting has been removed from the raspi-config.  There are postings about it now being a text setting in /boot/config.txt (enable_uart=1)

https://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3/

I set the setting to 1 and the gateway showed new probes but sometimes that setting gets mysteriously set back to 0.  I would check that if you are having serial trouble.
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Kilo95 on September 24, 2017, 03:57:10 PM
Thanks. I checked and it was already set to a 1
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Felix on September 25, 2017, 10:20:58 AM
Quote from: Kilo95 on September 22, 2017, 09:16:22 PM
[09-23-17_00:20:58.069] [INFO]  LOADING USER METRICS...
[09-23-17_00:20:58.112] [INFO]  LOADING USER METRICS MODULE [_example.js]

where it says "loading user metrics module" it says _example.js. Shouldn't that be metrics.js or am i wrong?
It first loads the master metrics then any files in the user folder.
It still looks like some serial error.
Without more info I cannot really tell what's going on.
Running the same sketches should be no different as long as your gateway can pass the messages via serial to the gateway app.
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Kilo95 on September 25, 2017, 10:32:51 AM
ls -l /dev command shows this:
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Kilo95 on September 25, 2017, 10:35:34 AM
Can't get it to cut and paste. It doesn't show Serial pointed to anything. Serial 1 points to /dev/ttyAMA0. I put that into the gateway settings but my Moteino USB is plugged into a USB port. I agree it seems like a serial issue. What other info can I get that would help?
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Kilo95 on September 25, 2017, 10:45:33 AM
I have tried using /dev/ttyAMA0 and USB0 in the Gateway and the serial port still seems to point to AMA0. I've switxhed off the console setting in raspi-config too
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Felix on September 25, 2017, 11:02:07 AM
Beware that it's possible something else is grabbing the serial port which preempts it.
So .. you need to ensure it's free to the app to use. When you can open it in minicom with the matching baud and can see the incoming packets (without anything else running that attempts to use the port, including the Gateway app), that's when you know it's usable.
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Kilo95 on September 25, 2017, 11:04:38 AM
My WiFi adapter is on one of the four USB ports. The Moteino USB is on another one
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Felix on September 25, 2017, 11:22:33 AM
The wifi should not generate a serial port.
The MoteinoUSB FTDI should generate a serial port (/dev/ttyUSB0).
Something is not right in your setup. Did you click "SAVE" when you updated your Gateway serial port setting to the USB0?
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Kilo95 on September 25, 2017, 11:39:58 AM
Yes. And then went and sudo reboot
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Felix on September 25, 2017, 12:11:06 PM
reboot is not required, this is not Windows :)

Try this command to see what process is using the serial port:

sudo lsof /dev/ttyUSB0
Then this to find the process with that id (use your PID from command above (if any) in command below):

ps aux | grep 25179
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Kilo95 on September 25, 2017, 12:31:39 PM
Wasn't sure on reboot. Thought I'd try.
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Kilo95 on September 25, 2017, 12:49:16 PM
I sent a screen shot of the output of those commands on the last reply
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Felix on September 25, 2017, 04:54:44 PM
ok so the gateway is using it, as expected. You can stop/start/restart the gateway with:

sudo systemctl stop/start/restart gateway

Try to stop it, use minicom, then restart, see if you still get garbled data.
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Kilo95 on September 25, 2017, 05:04:35 PM
i'm still getting garbled symbols
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Felix on September 25, 2017, 05:10:19 PM
Ok can you use the GPIO serial, just power the Moteino from the GPIO and hook up the serial (Tx to Rx and vice versa).
Then open minicom on ttyAMA0. The serial console is on GPIO (ttyAMA0) not on any other serial port.
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Kilo95 on September 25, 2017, 05:24:34 PM
havent connected one that way before but i can give it a shot tomorrow. so cross the rx and tx? RX to TX and TX to RX? just want to make sure not to screw something up.

as far as power, use 5vdc on the gpio (and a gnd), connected to VIN and GND on Moteino?
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Felix on September 26, 2017, 09:06:12 AM
Exactly.
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: HeneryH on September 26, 2017, 09:32:09 AM
Quote from: Kilo95 on September 22, 2017, 04:10:20 PM
still just gibberish:
ÿþÿÿÿÿàê~ÿþþþÿþàkþÿÿÿÿþÿÿÿÿÿÿþáÿk~ÿ

Silly question but...   did you set the baud rate on the serial console to match what is programmed on the sketches?
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Felix on September 26, 2017, 10:27:53 AM
Of course, they have to match at both ends.
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Kilo95 on September 26, 2017, 12:05:18 PM
hmm. werent the old sketches 115200 baud? that could be it. i didnt mess with the sketches, only the RPi
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: HeneryH on September 26, 2017, 12:34:10 PM
On the baud...  I was specifically talking about the serial console monitor.  If you are seeing gibberish.
Title: Re: just updated to Jessie and the new Pi Gateway
Post by: Kilo95 on September 26, 2017, 01:28:31 PM
i should have thought of that. thank you. i reset the baud rate in the Gateway settings to 115200 and it works perfectly via the ttyAMA0 so I switched back to USB and it works there too. Thanks to Felix and Henery!
Title: Re: No nodes show after update to Jessie and Gateway v8.10 [solved]
Post by: Felix on September 26, 2017, 01:42:42 PM
Thanks for the update. So the issue was mismatched baud rate (sketch at 115200 and app at 19200).
I would recommend changing your sketches to 19200, especially if you see some missing or garbled data. The PiGateway sketch in the RFM69 lib (https://github.com/LowPowerLab/RFM69/blob/master/Examples/PiGateway/PiGateway.ino) was long updated to reflect this change.
Title: Re: No nodes show after update to Jessie and Gateway v8.10 [solved]
Post by: Kilo95 on September 26, 2017, 02:19:53 PM
Yep. I haven't updated the sketches in prob 18 mo since they worked fine. I'll keep this in mind for next time 😊