Dear Core Electronics,
I purchased 2 PyCom LoPy modules. One of the LoPy modules is plugged into the Pysense board and the other is plugged into a Pycom Expansion Board 2.0. I have followed the instructions on the Pycom website for Firmware installation. See link below. This seemed to work for the LoPy module plugged into the Pysense board.
https://docs.pycom.io/chapter/gettingstarted/installation/firmwaretool.html#first
When I try to complete the firmware update with the Expansion Board 2.0 I get a message - The upgrade failed, please check the connections and try the setup steps again.
I am using a Mac - operating system Mac OS Sierra version 10.12.6.
I have a aerial attached to the LoRa connection.
I have jumper leads across the GND and Pin G23.
I swapped USB cables to check is this was the issue.
When the jumper leads are removed I can connect to the PyCom LoPy module using the wireless connection (with power delivered by the USB cable). The device shows up as lopy-wlan-4260.
I can ftp into the device using <ftp 192.168.4.1>. Using username - and password
I want to try to use LoRa between the two modules I have using some simple code uploaded into the directory and writing over <boot.py> and <main.py>.
This is where I have the issue.
The boot.py code is:
from machine import UART
import machine
import os
uart = UART(0, baudrate=115200)
os.dupterm(uart)
machine.main('main.py')
The main.py code that I want to upload is:
from network import LoRa
import socket
import time
import pycom
pycom.heartbeat(False)
lora = LoRa(mode=LoRa.LORA, region=LoRa.AU915)
s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
s.setblocking(False)
while True:
time.sleep(3)
pycom.rgbled(0xFF7F00) # yellow
time.sleep(3)
pycom.rgbled(0x0000FF) # blue
But this code seems to fail… and the rgbled light doesn’t light up.
If I just upload the <main.py> code:
from network import LoRa
import socket
import time
import pycom
pycom.heartbeat(False)
while True:
time.sleep(3)
pycom.rgbled(0xFF7F00) # yellow
time.sleep(3)
pycom.rgbled(0x0000FF) # blue
The rgbleds light up as per the while True loop. There seems to be something wrong with the LoRa component of the module - perhaps a library?
Can you please help.
Thanks
Edmond