Hello,
Everything works fine using RAK SERIAL PORT TOOL but how can I send AT commands using Putty, minicom, picocom, etc?
The device boots up and I see the boot text so RX works. I can also wake the the device by sending anything. However I can’t get any other response except “Wake up.”
I know I need to send CR+LF but nothing I do get any response except “Wake up.” sometimes. I have tried “+++” and various “at+…” commands but no reply. Everything works in RAK SERIAL PORT TOOL.
What is the RAK SERIAL PORT TOOL doing before sending the at commands to get the node into listening mode?
This is what I can’t figure out on Putty/minicom/picocom etc. I am using a patched version of Putty that is sending the required . I have also spent an hour failing on Linux on /dev/ttyUSB0 before failing more on Windows to confirm that it wasn’t an OS host issue. What settings or keystrokes do I need to get more than a wakeup?
What is that RAK SERIAL PORT TOOL does before sending that at+version command to get the node’s attention?
After sending the command you need to add \r\n to make the command take effect.
RAK SERIAL PORT TOOL is used to view the log, configure three parameters, modify configuration and other functions.
Hi @MattiasF
AT command is a string ending with the \r\n character,but Putty is character by character.
So Putty is not supported currently. On Linux OS,you could use cutecom serial port tool.
That’s it! I’ve done the \r\n in quite a few programs and OSes but that’s the key. Thank you!
I looked through the RAK repository for the serial processing code but I couldn’t find it. Wouldn’t be too much work to fix their code to not require the command to appear in one read()
Ended up heading over to StackExchange to learn more about stty to write a small shell script enabling job done on the terminal. Sharing here if others run into the same issue. Tested on Ubuntu18.04.
#!/bin/sh
# rakconnect.sh
# Usage:
# $ rakconnect.sh <device>
# Example: rakconnect.sh /dev/ttyUSB0
# Set up device
stty -F $1 115200 raw line 1 igncr ocrnl onlcr extproc hup
echo "Connected to $1 - CTRL-D to quit"
# Let cat read the device $1 in the background
cat $1 &
# Capture PID of background process so it is possible to terminate it when done
bgPid=$!
# Read commands from user, send them to device $1
while read cmd
do
echo "$cmd"
done > $1
# Terminate our background device reader
echo "Exiting"
kill $bgPid