Showing posts from February, 2021

Nearly the final code update... for this version

 Just pushed what is approaching the final code update for this version to github. Three main areas of change- It's neater with better comments - it's been needing a tidy up for a while. There's probably a couple more I can do soon two.  The watchdog is enabled. With the enabling of pymesh, I've been playing around with what to do if everything goes wrong and it crashes. The watchdog will restart the device after 5 seconds. I've tried consigning the scanning or the network component to a separate thread and it still crashes if it's on wifi then the wifi dies. Now at least the device restarts. I'd love it if I could just restart the pymesh but not there yet - looks like something is getting in the way. The tap writes to SD before being added to the transmit queue - this prevents data loss by crash. On the hardware side, I have a PN532 board coming from Singapore (expecting delivery anytime in the next month). I'm toying with sticking with the current NFC

Code changes

 Another change inspired by the Pi Wars conference was re-examining my use of threads. Let me add some more background. The pymesh lora mesh networking feature built into these devices and their corresponding pycom gateway is brilliant. It essentially nulls out the need for dedicated gateways to use lora to extend coverage beyond NB-IOT and wifi range. However, the catch was that whenever I enabled this feature performance slowed to a crawl. Evidently it was using a fair bit of processor grunt. it was probably using a fair bit of extra power too (I'll measure it at some point). The later I'm not worries about, battery life is already way above spec, but all that processor usage slowed the speed of reading and sending NFC data, and that was not good. The solution? Make my code run faster, and reduce processor usage. Easiest solution was I was running a thread that was not required. On the old code- Script started and did a lot of setting up Thread 1 started for NFC reading, time

Custom PCBs for the beginner

After a superb PiWars conference a couple of weeks ago, plus some encouragement from across the seas, I'm going to make a custom PCB, or to be more correct two custom PCBs, for the timing device. At present, the most time consuming thing when building the devices is all the soldered wire connections between the modules. Plus the fixing of the components to the interior of the case is not as slick or fast as I would like. But.... I am no electronics expert, and if we want a PCB this century I'm not going to be able to reverse engineer the modules. So, the plan is to make two large PCBs, one for each side of the case. Each side will have mountings for modules (soldered), effectively reducing the wire connections to just a short cable (with a connector) joining both sides and the aerial connectors. This allows me to incorporate a much higher performance Adafruit PN532 NFC reader into the design, although it will need a ferrite shielding panel. Find out about PiWars here -  https:/