I'm having trouble understanding how to structure my files for programming my LoPy, using atom.
First, should I make each program a separate project or can you have multiple programs within a project? If I define a directory item as a project, can I have other projects at lower subdirectories?
My second question has to do with including modules. I tried to run an example from pycom-libraries-master. I opened the file abp_node.py and pressed the run icon. This returned an error "mportError: no module named 'config' "
From a search of other posts here, it seems that config.py needs to be in a lib directory, but where does that go and how do I specify its location? I tried copying it to a lib directory under the directory with the abp_node.py example and that didn't work.
A related question is when using the REPL window, how do I import a non-standard file?
Thanks for any enlightenment you can provide.
@jubenjum The tutorial you are using is for the "main" line of MicroPython. Pycom has a separate branch which differs in quite a few places.
See the docs here for the Pycom version. The mode is passed as a periodic argument in that one.
I was following this excellent tutorial: https://core-electronics.com.au/tutorials/pycom-gpy-fipy-cellular-lte-firmware-update.html
But i ran into problems. I downloaded the NB1 firmware, and got the following files in the folder:
I have uploaded the NB1-41019.dup file to my SD card, and uploaded all the relevant files to the lib folder as instructed in the tutorial.
When i run the following code:
>>> import sqnsupgrade
>>> sqnsupgrade.run('/sd/NB1-41019.dup', 921600)
i get following response:
I tried to check my current version, seeing as there was other .dup files, but seems there has never been a upgrade, why i should be able to use he NB1-41019.dup file right?
Has anyone had similar issues?
EDIT: I think i solved it myself. Apparently the guide at Core Electronics is a bit outdated. I was able to do the upgrade, by not using the second argument, so just:
@ps47 also experienced similar errors like you have been observing . He is also using pure LoRa. Using the most recent 1.20.2.rc3 release seems to help here . Thanks @husigeza and the whole Pycom team for mitigating this issue.
I tried the new build LoPy4-1.20.2.rc3-0.8.0-vanilla-squirrel.tar.gz and not any “bad00bad bad00bad bad00bad” Core Panic happened till now.
With kind regards,
Another quick question, I have a Gpy, but the sim cards that I got to borrow for LTE-M and NB-IoT aren't certain if they're working. Is it possible to check if there is network coverage at all without a working sim card, with some of the Functions like lte.ue_coverage()? (This one only working for LTE I believe?) As I tried just using them with the examples in the Docs, making sure to flash the right firmware, but never ever got anything to attach.
@smarok Is there a specific reason you only want one advertisement? This goes a bit against the whole principle of advertisements, especially as:
an advertisement could be lost
an advertisement is always sent 3 times on 3 different channels anyway
Anyone receiving the advertisements should be able to deduplicate them (it's actually sometimes more difficult to get each repeated advertisement than to receive each of them).
If you really want to do that, your best bet is probably to set adv_int_min/max to something around the time you have advertisements turned on, so that there should be one and only one advertisement during that time. Use a relatively large value for that interval, as there's probably quite a bit of uncertainty at both ends. For instance you could use 1 second and set the advertising interval to 16000.