Added firmware updating
parent
ddf2248f0b
commit
515f589e5a
|
@ -2,6 +2,7 @@
|
||||||
firmware/*.hex
|
firmware/*.hex
|
||||||
firmware/*.key
|
firmware/*.key
|
||||||
firmware/*.counter
|
firmware/*.counter
|
||||||
|
update/*.hex
|
||||||
eeprom/*.eeprom
|
eeprom/*.eeprom
|
||||||
|
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
|
|
|
@ -55,6 +55,12 @@ sudo apt install python python-pip
|
||||||
sudo pip install pyserial cryptography
|
sudo pip install pyserial cryptography
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you want to use the utility for firmware updating or flashing, you will also need avrdude:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo apt install avrdude
|
||||||
|
```
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Just clone or download this repository, place wherever you'd like and run rnodeconf (remember to set executable permissions):
|
Just clone or download this repository, place wherever you'd like and run rnodeconf (remember to set executable permissions):
|
||||||
|
|
23
rnodeconf
23
rnodeconf
|
@ -621,12 +621,31 @@ if __name__ == "__main__":
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
if args.port:
|
if args.port:
|
||||||
|
if args.update:
|
||||||
|
if os.path.isfile("./update/rnode_firmware.hex"):
|
||||||
|
try:
|
||||||
|
RNS.log("Updating RNode firmware for device on "+args.port)
|
||||||
|
from subprocess import call
|
||||||
|
flash_status = call(["avrdude", "-P", args.port, "-p", "m1284p", "-c", "arduino", "-b", "115200", "-U", "flash:w:update/rnode_firmware.hex"])
|
||||||
|
if flash_status == 0:
|
||||||
|
RNS.log("Firmware updated")
|
||||||
|
args.info = True
|
||||||
|
else:
|
||||||
|
exit()
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
RNS.log("Error while updating firmware")
|
||||||
|
RNS.log(str(e))
|
||||||
|
else:
|
||||||
|
RNS.log("Firmware update file not found")
|
||||||
|
exit()
|
||||||
|
|
||||||
if args.flash:
|
if args.flash:
|
||||||
if os.path.isfile("./firmware/firmware.hex"):
|
if os.path.isfile("./firmware/rnode_firmware.hex"):
|
||||||
try:
|
try:
|
||||||
RNS.log("Flashing RNode firmware to device on "+args.port)
|
RNS.log("Flashing RNode firmware to device on "+args.port)
|
||||||
from subprocess import call
|
from subprocess import call
|
||||||
flash_status = call(["avrdude", "-P", args.port, "-p", "m1284p", "-c", "arduino", "-b", "115200", "-U", "flash:w:firmware/firmware.hex"])
|
flash_status = call(["avrdude", "-P", args.port, "-p", "m1284p", "-c", "arduino", "-b", "115200", "-U", "flash:w:firmware/rnode_firmware.hex"])
|
||||||
if flash_status == 0:
|
if flash_status == 0:
|
||||||
RNS.log("Done flashing")
|
RNS.log("Done flashing")
|
||||||
args.rom = True
|
args.rom = True
|
||||||
|
|
Loading…
Reference in New Issue