Test Pi gateway serial without Moteino? [solved]

Started by LukaQ, January 10, 2017, 04:34:55 AM

ababak

Hey Felix!

I am using the fresh software without any modifications except setting FREQUENCY to RF69_433MHZ. The baud rate is set to 19200 everywhere. I am using the default RandomNumbers sketch so the format is recognizable by the gateway and the temperature is shown on the LCD.

Here's what's inside the log:
[02-02-18_07:37:06.892] [INFO]  LOADING USER METRICS MODULE [_example.js]
[02-03-18_11:40:13.020] [INFO]  LOADING USER METRICS...
[02-03-18_11:40:13.052] [INFO]  LOADING USER METRICS MODULE [_example.js]
[02-03-18_13:44:08.737] [INFO]  LOADING USER METRICS...
[02-03-18_13:44:08.770] [INFO]  LOADING USER METRICS MODULE [_example.js]
[02-03-18_14:05:37.370] [INFO]  LOADING USER METRICS...
[02-03-18_14:05:37.402] [INFO]  LOADING USER METRICS MODULE [_example.js]
[02-03-18_14:12:12.153] [INFO]  AUTHORIZING CONNECTION FROM ::1:36798
[02-03-18_14:12:12.176] [INFO]  NEW CONNECTION FROM 192.168.10.3
[02-03-18_14:12:39.780] [LOG]   NODEACTION: {"nodeId":"98","action":"Sending some text"}
[02-03-18_14:19:46.375] [INFO]  AUTHORIZING CONNECTION FROM ::1:36810
[02-03-18_14:19:46.393] [INFO]  NEW CONNECTION FROM 192.168.10.3

The NODEACTION line shows that I've sent a command through gateway terminal. That's what I've got from the node:
ok!
 ok!
 ok!
 ok!
 ok!
 ok!
[1] SENDING SOME TEXT   [RX_RSSI:-61] - ACK sent
 ok!
 ok!


As far as I understand there should be the incoming serial data which is missing. Anything else I can check to pinpoint teh problem?

Thank you.

Regards,
Andrey

Felix

Looks like serial connection is OK
The Multiple loads of _example.js looks suspicious, not sure what to make of that. Is this log contiguous?

I don't see any of your data coming from your Random generator node?

Your gateway node ID is [1] right?
The log is confusing because it shows your node [1] sent this text: "SENDING SOME TEXT"
When in fact your reported that you sent it from the terminal?

The sketch assumes your Gateway is node ID 1, and the rest of your network is up to [255]. Make sure you are sending to node 1 in your Random generator sketch.

ababak

The multiple loads of _example.js are due to rebooting the Pi, the log is contiguous.

Yes, I don't see any of the data coming from the node as well.

Yes, I am using default code, the gateway is 1, the node is 98. The random generator is also using a default code so it's sending data to GATEWAYID which is 1. The MightyHat successfully gets the data as it shows it on the LCD.

I was using a built-in gateway terminal to send the "Sending some text" text to node 98, see attachment. So it looks like Pi is able to send data to MightyHat but cannot receive anything back.

Is there anything else I should check?

Thank you.

LukaQ

hey,

You should check that you do get data on serial port. First you need to see data there. Only then you you need to look at gateway.sys.log, gateway.db and gateway_nonmatches.db.

First show us that you do in fact get serial

ababak

Hey Luka,

That's exactly my problem, I can't get anything from the serial port of my Pi. Although it works for sending data from the gateway terminal.
If I connect an FTDI Adapter to MightyHat I see all the expected data. But nothing shows up on the Pi side - neither from the gateway logs nor from the minicom session directly.

LukaQ

Ok, then use some serial port terminal, like realterm or Arduino IDE, you must see something. If you don't see anything in any serial program, then we'll have to assume, that Moteino is not getting anything as one option

Felix

Ok, first stop the gateway app (sudo systemctl stop gateway) and use minicom or any serial app in the terminal, to monitor your MightyHat GPIO serial (/dev/ttyAMA0).
Once that works, we can debug further.

ababak

Unfortunately, no information is coming from /dev/ttyAMA0:

sudo minicom -b 19200 -o -D /dev/ttyAMA0


Although when I copy/paste "98:Test string" to minicom I see a response in the terminal connected to node 98. So it works for sending data but does not work for receiving data from the MightyHat. The MightyHat itself receives the radio data from node 98 and I see that on its LCD and if I connect an FTDI directly to MightyHat and listen to the Serial traffic.

If there's nothing else to be checked at a software level, I'll try to use another Pi.

Thanks.

Felix

Looks like a hardware/connection issue, trace your TX/RX signals from the MHat to the GPIO header and see if the connection is solid all the way, you can do it with continuity on your DMM. If you have a scope or logic analyzer you could actually decode the messages.
Make sure not to have an FTDI-Adapter connected to the MHat while connected to the Pi, it is only for programming the MHat, only the 2 devices should be on a serial bus.

ababak

#24
Quote from: Felix on February 06, 2018, 02:26:01 PM
Looks like a hardware/connection issue, trace your TX/RX signals from the MHat to the GPIO header
Hi Felix,
Am I right that there should be a connection between these two points? (There is no in my case)

I mean in my case there is no electrical connection between these points. I thought the multimeter should show one.

Felix

Oops, yes you are correct, there should definitely be a connection. The MightyHat has a trace going from the Atmega328p TX pin to the GPIO RX pin.
So ... depending where the break is, you might just fix it with a wire if that's the easiest fix.

ababak

Cool, after soldering a wire it works now!
Thanks.