在XIAO SAMD21 + LoRa-E5上通过串口运行程序,使用外部电源供电。

huangapple go评论70阅读模式
英文:

Run a program on XIAO SAMD21 + LoRa-E5 via serial with external power supply

问题

I need to send data through LoRaWAN and I'm using the excellent LoRa-E5 module for this:

https://wiki.seeedstudio.com/LoRa_E5_mini/

I can send data to my public network by typing a couple of AT commands in the Arduino IDE software.

Hopefully, there are better ways to pilot the LoRa module. In the manual, it says I can use, for example, the XIAO SAMD21:

https://wiki.seeedstudio.com/Seeeduino-XIAO/

So I followed the manual and connected them through serial TX/RX pins. I plugged the XIAO into my computer, uploaded the program, and it's working fine, transmitting data to my public network. The problem is this: if I plug it into another power source (battery, USB-C other than the PC...), it doesn't do anything, and the blue light, showing RX/TX communications, is never flashing. Also, if I close the Arduino IDE software and plug the XIAO into my PC, the program doesn't start, and no data is sent.

I thought this module was not able to run without the Arduino program opened. I thought it couldn't work like any ESP32, for example, in which you upload a program and it can run with any external power? But when I upload a simple program where I just blink the LED, it will blink if the XIAO is plugged into either my PC or an external plug.

What am I missing? Why can't the XIAO / LoRa-E5 start when it is plugged in with an external power supply?

The program I'm using is based on Sylvain Montagny's library:

https://github.com/SylvainMontagny/LoRaE5

Thanks for your time and insights once again.

英文:

I need to send data through LoRaWAN and I'm using the excellent LoRa-E5 module for this:

https://wiki.seeedstudio.com/LoRa_E5_mini/

I can send data to my public network by typing a couple of AT commands in the Arduino IDE software.

Hopefully, there are better ways to pilot the LoRa module. In the manual, it says I can use for example the XIAO SAMD21:

https://wiki.seeedstudio.com/Seeeduino-XIAO/

So I followed the manual and connect them through serial TX/RX pins. I plug the XIAO to my computer, I upload the program, and it's working fine and transmit data to my public network.
The problem is this: if I plug it to another power source (battery, USB-C other than the PC...) it doesn't do anything and the blue light, showing an RX/TX communications, is never flashing.
Also, if I close the Arduino IDE software and plug the XIAO to my PC, the program doesn't start and no data is sent.

I thought this module was not able to run without the Arduino program opened. I thought it couldn't work like any ESP32 for example in which you upload a program and it can run with any external power? But when I upload a simple program where I just blink the led, it will blink if the XIAO is plugged either on my PC or on an external plug.

What am I missing? Why the XIAO / LoRa-E5 can't start when it is plugged with an external power supply?

The program I'm using is based on Sylvain Montagny's library:

https://github.com/SylvainMontagny/LoRaE5

Thanks for your time and lights once again.

Laurent

答案1

得分: 0

抱歉,我只返回翻译好的部分,以下是翻译内容:

"如果对某人有所帮助,我的错误出现在代码中。我有:

void setup() {

LoRa_Serial.begin(9600);

USB_Serial.begin(9600);

while (!USB_Serial);

USB_Serial.println("#######################################");

...

解决方案是注释掉包含"USB_Serial"的行... 因为我不再使用USB线连接了!"

英文:

In case it can serve someone, my mistake was in the code. I had:

void setup() {

LoRa_Serial.begin(9600);

USB_Serial.begin(9600);

while (!USB_Serial);

USB_Serial.println("#######################################");

...

The solution was to comment the lines containing "USB_Serial" ... since I was not connected anymore with the USB cable!

huangapple
  • 本文由 发表于 2023年5月15日 03:30:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/76249334.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定