This command RAKLoRa.rk_setWorkingMode(0) gives me the output:
LoRa (R) is a registered trademark or service mark of Semtech Corporation or its affiliates. LoRaWAN (R) is a licensed mark.
RAK811 Version:3.0.0.14.H
UART1 wo
I got this message by printing the res variable on the RAK811.cpp
ret = rk_recvData();
Serial.print("Ret: ");
Serial.println(ret);
And when trying to use the same command with the RAK SERIAL PORT TOOL I got absolutely no reply from this command, the others (like status and version) works just fine before using this one, after it they also stop responding until I remove and insert the USB again.
This is a long standing issue with the library - the device only every needs this doing ONCE, not every time you start it up, nor does it need all the keys etc setting up every time you start it up. But that’s what the library does.
The wrinkle is that you have to reset the module after issuing the working mode command and there is no reset line, so the script just hangs as soon as the the command is issued.
Just comment it out.
Maybe one day I’ll have time to sort out a git clone / pull request. Or someone at RAK could just remove it.
I’m not using arduino library, but encountered on the same issue on RAK811 on custom board - hang up when trying to set work_mode.
I also tried “at+set_config=device:restart” and it also hanged up waiting hardware reset.
I have WisNode board that work properly and automatically reset itself.
The investigation shown that in custom board I set RST pin to “strong” 3.3V using my MCU.
When RAK811 wants to reset itself after these at commands it set RST pin to the ground, but it can’t overcome external MCU - there is around 2.6V on the pin.
So the simple solution is not set RST pin at all, RAK811 already internally pull up RST pin to 3.3V.
@SWoto in your current state try send “at+set_config=device:restart” command and if it hangs same way, I think you have the same issue with RST, it better to fix it with correct configure of external MCU, of course you can eliminate setting mode every time, but not worked “at+set_config=device:restart” is the bug after all.
@SWoto I replicate your case using WisNode v1.2 board and it seems to be working fine. I can get replies via Rak serial tool and I can directly use the arduino library with no modification.
Sorry @carlrowan, that’s not replicating it - you HAVE to use an Arduino and the released library to see the problem.
However, good news, I can replicate what you did, which is why it was a puzzler when I first came across the problem - the serial tool worked, the Arduino just stopped.
It may be as simple as looking for the correct startup string in the library, I didn’t look that hard when I first diagnosed the problem as I didn’t see the point in setting up the module each and every time the sketch started. So I have a provisioning setup and the actual device sketch. This rather solves the problem of embedding keys in to the sketch or having some layer on the Arduino over serial to set the keys to then pass them on to the module.
Yes @nmcc, I did replicate it on actual Arduino uno board. I wasn’t able to post the photo though. I did use v3.0.0.13 and v3.0.0.14 to be sure. @SWoto and I have the same and most updated firmware that’s why I am interested to see his hardware setup. It seems that the RAK811 can’t reset properly on his case.
I’ve WisDuino v1.2 boards plus breakout boards and they lock up. I’ve updated firmware so much of late I can’t recall which ones are running what, but I can check again.
@carlrowan, I’m currently without a windows computer at this moment so i can’t use the RAK SERIAL PORT TOOL to check it again. I’ll try to do it as soon as i find one xD
Also, i did test it on a custom board with SAMD51 not the actual Arduino board. I will test it on Arduino Due (because of the 3.3V logic) and let you know the results.
I can’t validate yet on Arduino Mega. I’ll check if I can get one later.
How did you setup your DebugSerial and ATSerial? If you use the default from the library, ATSerial is configured to softwareserial that is connected to pin 10 and 11. But if you setup it to ArduinoMega hardware serial, it might work as well though I still need to validate this. It seems on your photo the TX and RX of WisNode is connected to RX1/TX1 of Arduino Mega.
Yes, i ended used the RX1/TX1 for serial communication with the RAK811 and RX/TX for debug serial, didn’t use any part of the SoftwareSerial.
PREVIUS:
#define TXpin 11 // Set the virtual serial port pins
#define RXpin 10
#define DebugSerial Serial
SoftwareSerial ATSerial(RXpin,TXpin); // Declare a virtual serial port
CURRENT:
#define ATSerial Serial1
#define DebugSerial Serial
I’ll get an Arduino Uno and update here of what happened.
I use 9600 on software serial with no troubles at all - and as I said, I don’t have the sketch set the work mode if I don’t have a reset line, which on newer builds, I do, just to be sure.