Hi is there any possibility today to change the working frequency band of a Ve.Direct to LoRaWAN from band US902-928 to AU915?
This can be done by local dealers?
Kind regards
Timo
This site is now in read-only archive mode. Please move all discussion, and create a new account at the new Victron Community site.
@Timo Jurado have a look in the transmitter.py file stored on pycom
Transmitter class, handles LoRaWAN connectivity.
# LoRaWAN region, used for setting which freqencies we use
LORAWAN_REGION = 'au'
# LoRaWAN OTAA configuration
LORAWAN_APP_EUI = '70b88888888888'
LORAWAN_APP_KEY = '3f8888888888888888888888880'
Hi Simon,
thank you very much for this comment. It makes me some hope. You have any other hint or tutorial how to access the transmitter.py file? I have already Studio VS Code and "Pymakr" Plugin installed but can't see or find the mentioned file.
Kind regards
Timo
@Timo Jurado using a pycom expansion board and VS or Atom , what files do you have?, its possible we have different versions
I could access in the developer mode the transmitter.py file and changed LORAWAN_REGION = 'us' to LORAWAN_REGION = 'au'. Is there something else to do because in the terminal get stuck when try to connect to US TTN, I have the same output.
[ 1.375] Coupling LoPy, version LoPy4-92976c6-1.15.0.b1 [ 1.408] Setting up LoRaWAN connection... [ 1.446] Setting up LoRaWAN frequencies for TTN US region... [ 1.675] Dev EUI: 70b3d5499d27144d [ 1.679] App EUI: 70b3d57ef0005f34 [ 1.683] App Key: 4d79432c35ad44e34e592bbd2bcef70b [ 1.688] Waiting for module to join network...
Transmitter class file. """ import binascii import errno import math import usocket import utime from encoder import binpack_mark_message from reader import Reader from network import LoRa from micropython import const class Transmitter: """ Transmitter class, handles LoRaWAN connectivity. """ # LoRaWAN region, used for setting which freqencies we use LORAWAN_REGION = 'au' # LoRaWAN OTAA configuration LORAWAN_APP_EUI = '70b3d57ef0005f34' LORAWAN_APP_KEY = '*******'
Thank you very much @Simon ! The file looks nearly identical but in my version there were missing the self. definitions at the end of the file so I add these lines to my transmitter.py file.
Now the main problem is I can´t transfer write (sync project) to the PYCOM lopy4 memory. I get different kind of error message. Also with the help of ChatGPT no solution yet.
1) OSError: file exists: '.'
failed to upload c:\_iot\pycom_lopy4 to Reason: Error: Traceback (most recent call last): File "<stdin>", line 7, in <module> File "<stdin>", line 7, in <module> File "<stdin>", line 4, in <module> OSError: file exists: '.'
2) I am not 100% sure if the rootPath "flash/" is correct? I have the following file structure on the PYCOM
>>> import os >>> os.listdir() # List the contents of the root directory ['main.py', 'sys', 'lib', 'cert', 'boot.py', 'encoder.py', 'nanomsgpack.py', 'queue.py', 'reader.py', 'transmitter.py', 'vedirect.py', 'flash']
Hi Simon,
I tried it with a simple serial UART connection on PIN0/RX and P1/TX and 3,3VDC supply like mentioned in the manual and layout pycom-lopy4-pinout.pdf
But it seems that it doesn´t establish correct a connection. I get a terminal output but the Pymakre project doesn´t load any files. The Pymakr indicates the following error "Could not safeboot device. Please hard reset the device and verify that a shield is installed".
The Terminal window gives me this message:
[ 901.708] Timed out trying to connect to LoRaWAN network after 900000ms! [ 901.713] Exception caught in transmitter: Traceback (most recent call last): File "main.py", line 131, in catch_reset File "transmitter.py", line 85, in run File "transmitter.py", line 186, in _connect RuntimeError: LoRaWAN connect timeout [ 901.729] Resetting in 10000ms! ets Jun 8 2016 00:22:57 rst:0x7 (TG0WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:1 load:0x3fff9028,len:8 load:0x3fff9030,len:1060 load:0x4009fa00,len:0 ho 12 tail 0 room 4 load:0x4009fa00,len:14084 entry 0x400a05d4 [ 912.113] Coupling LoPy, version LoPy4-92976c6-1.15.0.b1 [ 912.145] Setting up LoRaWAN connection... [ 912.184] Setting up LoRaWAN frequencies for TTN US region... [ 912.413] Dev EUI: 70b3d5499d27144d [ 912.416] App EUI: *************** [ 912.421] App Key: *************** [ 912.425] Waiting for module to join network...
https://alepycom.gitbooks.io/pycom-documentation/content/chapter/gettingstarted/connection/lopy4.html#diy
Apreceate any advice how to acces the transmitter.py" file to change the band form "us" to "au".
Kind regards
Timo
@Simon thanks for the advices! Like you can imagine its the first time for me, but I will give a try.
1) We went back to VSCode 1.8
2) We started the device in safe boot mode (holding 1-3 sec, 3,3VDC to PIN12)
We have the following folder structure and recognized that the main.py and boot.py files are empty. Is this normal? Please can you confirm or share the right file structure as backup to flash files and folders to the root directory */* or */flash* directory of the PYCOM?
Unfortunatly still get always errors during the Pymakr-project upload.
failed to upload c:\_iot\pycom_lopy4 to / Reason: Error: Traceback (most recent call last): File "<stdin>", line 7, in <module> File "<stdin>", line 7, in <module> File "<stdin>", line 4, in <module> OSError: error creating directory '/'
also disable auto updates is VS once a fresh install of V 1.89.1 is done.
root dir, if you have to you can go back to fresh with Pymaker updater but keep your Lora EUI's and app key safe ,
Pycom MicroPython 1.20.2.r6 [v1.11-c5a0a97] on 2021-10-28; FiPy with ESP32
Pybytes Version: 1.7.1
Type "help()" for more information.
>>> [ 10.996] Setting up LoRaWAN connection...
[ 11.053] Setting up LoRaWAN frequencies for TTN AU915 region...
[ 11.229] LoRaWAN Dev EUI: 70888888888
[ 11.241] LoRaWAN App EUI: 7088888888888
[ 11.253] LoRaWAN App Key: 88888888888888888888888888888888888
[ 11.265] Waiting for module to join LoRaWAN network...
[ 16.275] LoRaWAN connected.
Hi @Simon, we are back and we managed to compare and upload your transmitter.py file for the AU915 band. For documentation there was the following difference in channel range (8,15) in comparison to the original US915 band file.
if self.LORAWAN_REGION == 'au': if self.lora.frequency() != 915000000: raise RuntimeError( 'Invalid firmware for AU region. Reported LoRaWAN frequency: {}'.format(self.lora.frequency()) ) self._log('Setting up LoRaWAN frequencies for TTN AU region...') for i in range(0, 72): self.lora.remove_channel(i) for i in range(8, 15): self.lora.add_channel(i, frequency=916800000+i*200000, dr_min=0, dr_max=3) self.lora.add_channel(8, frequency=917500000, dr_min=4, dr_max=4)
Now we have another challange to sucessfully conect the device to TTN Latam. We recieve some JOIN messages in our lora gateway but it doesn´t connect. When we try to manually add the device in the our aplication in the TTN console we get the following error "device is already registered as in application victronenergy-coupling-v1".
{ "code": 6, "message": "error:pkg/identityserver:end_device_euis_taken (an end device with JoinEUI 70XXXXXXXXXXXF34 and DevEUI 70B3D5499D27144D is already registered as 70b3d5499d27144d in application victronenergy-coupling-v1)", "details": [ { "@type": "type.googleapis.com/ttn.lorawan.v3.ErrorDetails", "namespace": "pkg/identityserver", "name": "end_device_euis_taken", "message_format": "an end device with JoinEUI {join_eui} and DevEUI {dev_eui} is already registered as {device_id} in application {application_id}", "attributes": { "application_id": "victronenergy-coupling-v1", "dev_eui": "70B3D5499D27144D", "device_id": "70b3d5499d27144d", "join_eui": "70XXXXXXXXXXXF34" }, "correlation_id": "26fb8881b06e4577b34ea795ac97282e", "code": 6 } ] }
The upload JOIN message from TTN console looks like this:
Console: { "name": "gs.up.receive", "time": "2024-08-07T01:51:25.694236433Z", "identifiers": [ { "gateway_ids": { "gateway_id": "eui-343632381e006800", "eui": "343632381E006800" } } ], "data": { "@type": "type.googleapis.com/ttn.lorawan.v3.GatewayUplinkMessage", "message": { "raw_payload": "ADRfAPB+1bNwTRQnnWlVsXBSY1ofQO4=", "payload": { "m_hdr": {}, "mic": "Wh9A7g==", "join_request_payload": { "join_eui": "70XXXXXXXXXXXF34", "dev_eui": "70B155699D27144D", "dev_nonce": "6352" } }, "settings": { "data_rate": { "lora": { "bandwidth": 125000, "spreading_factor": 10, "coding_rate": "4/5" } }, "frequency": "917200000", "timestamp": 654636276, "time": "2024-08-07T01:51:22.490760Z" }, "rx_metadata": [ { "gateway_ids": { "gateway_id": "eui-343632381e006800", "eui": "343632381E006800" }, "time": "2024-08-07T01:51:22.490760Z", "timestamp": 654636276, "rssi": -96, "channel_rssi": -96, "snr": -8, "uplink_token": "CiIKIAoUZXVpLTM0MzYzMjM4MWUwMDY4MDASCDQ2MjgeAGgAEPTpk7gCGgwInabLtQYQ/se0yQIgoLLz2oaBBg==", "channel_index": 2, "received_at": "2024-08-07T01:51:25.569913250Z" } ], "received_at": "2024-08-07T01:51:25.690824190Z", "correlation_ids": [ "gs:uplink:01J4N8HAZYWZGCGPCAXJ15Q8BD" ], "crc_status": false }, "band_id": "AU_915_928" }, "correlation_ids": [ "gs:uplink:01J4N8HAZYWZGCGPCAXJ15Q8BD" ], "origin": "ip-10-101-5-86.us-west-1.compute.internal", "context": { "tenant-id": "CgN0dG4=" }, "visibility": { "rights": [ "RIGHT_GATEWAY_TRAFFIC_READ" ] }, "unique_id": "01J4N8HAZYQDTWMMBKZV40EXWT" }
We are lost again on this point ;-) Is there anything else what we can try to solve this?
Kind regards
already registered as 70b3d5499d27144d in application victron - This is correct
Getting closer good stuff, do you get a green LED on the Pycom? check VRM add to the device to the Victron portal if required
Hi @Simon:
@Timo Jurado uploads are not working her still, I have a back up of the pycom and some screen shots to send to you flick me your email address if your in au can give you a call
Hi @Simon at the end we used the MicroPython Tool (ampy) to upload the files over a serial connection because Pymakr/VSCode didn´t work correctly. Still we haven´t found a solution and happy to get your backup and screen shots. My mail timo.jurado@gmail.com
The following line in your transmitter.py file under the 'au' frequency band section is default or you added it to the file?
self.lora.add_channel(8, frequency=917500000, dr_min=4, dr_max=4)
Additional resources still need to be added for this topic
47 People are following this question.