Search found 129 matches

by WhiteHare
Wed Oct 31, 2018 11:37 pm
Forum: General Discussion and Questions
Topic: Use micropython to do dead simple "over-the-air" code updates
Replies: 34
Views: 25963

Re: Use micropython to do dead simple "over-the-air" code updates

Copying to a buffer can be done more efficiently using a memoryview: mv = memoryview(radioBuffer) def copyStringToRadioBuffer(s): l = len(s) mv[: l] = s.encode('utf8')[: l] mv[l] = 0 Whoops! Your code produced an error message: Hello. I am the transmitter node. My address is 0xAAFEEDBEEF The target...
by WhiteHare
Wed Oct 31, 2018 4:31 pm
Forum: General Discussion and Questions
Topic: Use micropython to do dead simple "over-the-air" code updates
Replies: 34
Views: 25963

Re: Use micropython to do dead simple "over-the-air" code updates

Great work! Getting the proprietary radio working must have taken a lot of effort. I now feel very tempted to get a couple of those modules. If I may be permitted a few comments there are ways to make the code more efficient. Each constant uses 8 bytes of RAM: this is because they can be imported f...
by WhiteHare
Tue Oct 30, 2018 9:29 pm
Forum: General Discussion and Questions
Topic: Use micropython to do dead simple "over-the-air" code updates
Replies: 34
Views: 25963

Re: Use micropython to do dead simple "over-the-air" code updates

I posted working OTA micropython code on github: https://github.com/rabbithat/NRF52840_MicroPython_OTA_Updates for both the transmitter node and the receiver node (i.e. the node whose code is to be updated over the air). In short, you copy the updated receiver code to a file called "update.txt" on t...
by WhiteHare
Tue Oct 30, 2018 6:25 pm
Forum: Other Boards
Topic: [nRF52] How do I increase the amount of flash allocated to micropython's micro file system?
Replies: 8
Views: 6749

[nRF52] How do I increase the amount of flash allocated to micropython's micro file system?

As an example, on an nRF52840 by default there's enough space in the micro file system to store two ~12K micropython (.py) files, but apparently not enough space for three or more. Yet, the nRF52840 comes standard with 512K of flash memory, so there should be plenty more space that can be allocated ...
by WhiteHare
Tue Oct 30, 2018 3:15 pm
Forum: General Discussion and Questions
Topic: Use micropython to do dead simple "over-the-air" code updates
Replies: 34
Views: 25963

Re: Use micropython to do dead simple "over-the-air" code updates

Thanks for the suggestions. There are doubtless many ways to make this better and more bomb proof and faster, but as a very simplified first attempt what I did was transmit each payload 3 times in a row. Each payload contains an identifier, so any received packets that are redundant are just discard...
by WhiteHare
Mon Oct 29, 2018 7:54 pm
Forum: Other Boards
Topic: [nRF52] How to get rshell to work with an nRF52?
Replies: 30
Views: 18856

Re: [nRF52] How to get rshell to work with an nRF52?

Hmm. If you connect via the regular REPL, what does the output of: ``` >>> import sys >>> sys.stdin.buffer ``` show? MicroPython v1.9.4-651-g0f6f86ca4-dirty on 2018-10-27; PCA10056 with NRF52840 Type "help()" for more information. >>> import sys >>> sys.stdin.buffer Traceback (most recent call last...
by WhiteHare
Mon Oct 29, 2018 7:04 pm
Forum: Other Boards
Topic: [nRF52] How to get rshell to work with an nRF52?
Replies: 30
Views: 18856

Re: [nRF52] How to get rshell to work with an nRF52?

You seem to be missing the options to specify the serial port to connect to. rshell only connects automatically to USB Serial ports which have a vendor name of "MicroPython", otherwise you need to specify the serial port using the --port command line option. You mean like this? root@debian:/home/da...
by WhiteHare
Mon Oct 29, 2018 6:13 pm
Forum: Other Boards
Topic: [nRF52] How to get rshell to work with an nRF52?
Replies: 30
Views: 18856

Re: [nRF52] How to get rshell to work with an nRF52?

@WhiteHare It would be useful to get a logfile of the output of running rshell with the -d command line option, in addition to whatever other command line options you're using. One of the commands rshell issues when first connecting to a board is the os.listdir command. Behold: root@debian:/home/da...
by WhiteHare
Mon Oct 29, 2018 4:58 pm
Forum: Other Boards
Topic: [nRF52] How to get rshell to work with an nRF52?
Replies: 30
Views: 18856

Re: [nRF52] How to get rshell to work with an nRF52?

I'd really like to have a way to copy a file from the target so that I can run a diff against the file that I transmitted OTA there. Right now the closest I can do is print a file to the UART.
by WhiteHare
Mon Oct 29, 2018 12:10 pm
Forum: General Discussion and Questions
Topic: Use micropython to do dead simple "over-the-air" code updates
Replies: 34
Views: 25963

Re: Use micropython to do dead simple "over-the-air" code updates

I'm not familiar with their proprietary radio, but their NRF24l01+ performs checksumming and automatic retransmission. So you can be confident that any packet you receive will be correct. Where a message comprises multiple packets you need to check that every packet has been received before attempt...