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.
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)
i'm just getting gibberish in minicom. no serial data like it usually does
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.
still just gibberish:
ÿþÿÿÿÿàê~ÿþþþÿþàkþÿÿÿÿþÿÿÿÿÿÿþáÿk~ÿ
I was thinking of reuploading the PiGateway sketch. i'll give that a try
i plugged my gateway moteino into my PC and turned the serial monitor on and it works fine.
Had the same issue with no Motes showing up when I installed the new version (8.10). Went back to 8.9 :P
I don't have 8.9 to use. I'm sure Felix can help me figure it out
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?
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.
Thanks. I checked and it was already set to a 1
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.
ls -l /dev command shows this:
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?
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
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.
My WiFi adapter is on one of the four USB ports. The Moteino USB is on another one
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?
Yes. And then went and sudo reboot
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
Wasn't sure on reboot. Thought I'd try.
I sent a screen shot of the output of those commands on the last reply
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.
i'm still getting garbled symbols
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.
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?
Exactly.
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?
Of course, they have to match at both ends.
hmm. werent the old sketches 115200 baud? that could be it. i didnt mess with the sketches, only the RPi
On the baud... I was specifically talking about the serial console monitor. If you are seeing gibberish.
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!
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.
Yep. I haven't updated the sketches in prob 18 mo since they worked fine. I'll keep this in mind for next time 😊