Can't Upload to to RAK4630 using Arduino IDE

This is a real head scratcher for me.

I’m using windows 11 and either Arduino IDE 1.8 or 2.0 with the same result.

Using the terminal in the Arduino IDE, I can send a
AT+VER=?
which returns
+VER:1.0.0 Dec 10 2021 15:33:47
OK
This validates that the RAK4630 is indeed on my COM7.
However, when I compile any example the upload goes off the rails with
2023-04-01 22:30:22,827 Using board at serial port: COM8
2023-04-01 22:30:22,837 Sending Application image.
2023-04-01 22:30:26,461 No trigger interface found for device with serial number: 33C85FD9C9268852, Product ID: 0x002A and Vendor ID: 0x239A

Note the reference to “COM8” WTF?
Following the above is by a long run of timeout messages, and finally erroring out with

Traceback (most recent call last):
File “nordicsemi_main_.py”, line 1545, in
File “click\core.py”, line 1137, in call
File “click\core.py”, line 1062, in main
File “click\core.py”, line 1668, in invoke
File “click\core.py”, line 1668, in invoke
File “click\core.py”, line 1404, in invoke
File “click\core.py”, line 763, in invoke
File “nordicsemi_main_.py”, line 1063, in serial
File “nordicsemi_main_.py”, line 980, in do_serial
File “nordicsemi\dfu\dfu.py”, line 127, in dfu_send_images
File “nordicsemi\dfu\dfu.py”, line 88, in _dfu_send_image
File “nordicsemi\dfu\dfu_transport_serial.py”, line 214, in open
pc_ble_driver_py.exceptions.NordicSemiException: No ping response after opening COM port
[22924] Failed to execute script ‘main’ due to unhandled exception!
CompletedProcess(args=[‘C:\Users\admin\Documents\ArduinoData\packages\rak_rui\tools\pc-nrfutil\v6.1.3/nrfutil’, ‘-v’, ‘-v’, ‘-v’, ‘dfu’, ‘serial’, ‘–package’, ‘C:\Users\admin\AppData\Local\Temp\arduino_build_836329/Arduino_Time.ino.zip’, ‘-p’, ‘COM8’, ‘-b’, ‘115200’], returncode=1)
processing.app.SerialException: Error opening serial port ‘COM7’.
at processing.app.Serial.(Serial.java:152)
at processing.app.Serial.(Serial.java:82)
at processing.app.SerialMonitor$2.(SerialMonitor.java:132)
at processing.app.SerialMonitor.open(SerialMonitor.java:132)
at processing.app.AbstractMonitor.resume(AbstractMonitor.java:132)
at processing.app.Editor.resumeOrCloseSerialMonitor(Editor.java:2126)
at processing.app.Editor.access$1300(Editor.java:116)
at processing.app.Editor$UploadHandler.run(Editor.java:2095)
at java.lang.Thread.run(Thread.java:748)
Caused by: jssc.SerialPortException: Port name - COM7; Method name - openPort(); Exception type - Port not found.
at jssc.SerialPort.openPort(SerialPort.java:167)
at processing.app.Serial.(Serial.java:141)
… 8 more
Error opening serial port ‘COM7’.

The RAK4630 and related sensor modules was supplied by the client. The objective is to send out a bunch of sensor measurement messages over LoRaWAN using only the RAK4630. This will be a battery operated device. I don’t care that much which tool chain I use, as long as I can use existing RAK sensor and Lora libraries as much as possible.
How do I best move ahead with code development?

Thanks for any help.

  • Mike Seiler, MSEE

This tells me that your device is with the Arduino Bootloader.

This one tells me that you are using the RUI3 BSP for the device.

That doesn’t work.

If you want to use RUI3, follow this guide to switch your device to RUI3 bootloader in our RUI3 Documentation

Thanks for your quick reply.
I tried updating the firmware a couple of days ago, and I get the same error again when I try that today. I am using the terminal built into the Arduino IDE for convenience instead of Tera Term.
When I send the
AT+BOOT
I get back
+CME ERROR:1
Does Tera Term do something different with NL & CR? What else might cause the error message?
As a sanity check,
AT+VER=?
still returns
+VER:1.0.0 Dec 10 2021 15:33:47
and then
OK
Is it odd that the AT version command works but not the the AT boot command?

Arduino BSP and the open source WisBlock-API has a AT command interface that is similar but not identical to the RUI3 AT command interface.
The open source version DOES NOT have an AT+BOOT command, because the interface to flash new firmware is different.

You have a device with Arduino BSP bootloader and you CANNOT use RUI3 unless you update the bootloader as I mentioned before.

Thanks again for your quick response, beegee.
At the bottom of your initial answer, you suggested reflashing to the RUI3 bootloader. RUI3 Documentation This made sense since the sleep current is less. As you know, this is important for battery operated LoRa devices.
In any case, the documentation for flashing to the RUI3 bootloader refers to issuing the AT+BOOT command in step 5. This looks like a classic Catch 22.
Both of my versions of the Arduino want to use a method of uploading that seems to be incompatible with the firmware that is in the RAK4630.
Is my only way forward to use the Recovery Mode referred to in step 5?
By “way forward” I mean being able to upload my own custom code to the RAK4630.

  • Mike

Put another way, which code development stack is my version of RAK4630 compatible with?

I think you are on the wrong guide.

You have to follow Updating RAK4631 to RUI3.

If you want to stay on open source Arduino BSP, you can follow this guide Installation of Board Support Package in Arduino IDE.

If you have already the RUI3 BSP’s installed, you will see multiple entries when selecting the board:

Use the RAKwireless nRF Modules ==> WisBlock RAK4631

I was able to update to the latest version,
3.4.2-rui3_22q1_update.112
I can now upload code through the Arduino IDE.
Thank your again for your quick responses.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.