How can I achieve reliable data transfer over LoRa using MicroPython on Pycom GPy?
@Middleware & OS
I'm developing a smart agriculture system using a
Pycom GPy
, which features an ESP32
microcontroller with LTE
and LoRa
capabilities. The system is running MicroPython
, and I'm using a soil moisture sensor to monitor soil conditions. My goal is to read soil moisture data and send it over LoRa
to a remote gateway.
I've written the following code to initialize the soil moisture sensor and set up LoRa
communication, but I'm encountering errors, I'm unable to get valid readings from the soil moisture sensor, and the LoRa transmission does not seem to be working.
ValueError: invalid pin for ADC
Not joined yet...
I have verified the sensor connection and checked the pin configuration, ensured that the LoRa
credentials (DevEUI, AppEUI, AppKey
) are correct and match those provided by the network, cross checked the LoRaWAN regional settings and ensured the frequency is set correctly, verified the LoRa antenna is properly connected. But still getting the errors.
How can I resolve these issues to successfully read data from the soil moisture sensor and transmit it via LoRa using MicroPython on the Pycom GPy? Please provide any necessary configuration changes or code corrections.
Here's my codeSolution:Jump to solution
Hello guys, after a while of debugging and checking through I was able to fix the
ValueError: invalid pin for ADC
on my code, it turns out I was required to use p15 intead of p13 and for the Not joined yet...
error it was due to tge mistake I made in imputing my Appkey which i have corrected now.
This is My. Code
```python
from machine import Pin, ADC
from network import LoRa...4 Replies
i think it's an connection problem with device
Solution
Hello guys, after a while of debugging and checking through I was able to fix the
ValueError: invalid pin for ADC
on my code, it turns out I was required to use p15 intead of p13 and for the Not joined yet...
error it was due to tge mistake I made in imputing my Appkey which i have corrected now.
This is My. Code
But am now having issues sending the data as it is not reflecting anything
@everyone @Middleware & OS