Where to start - Wanting to use Pycom to build myself a monitor

Hi, I spent some time over the last few months reading forum posts and the documentation, loading up my brand new LOPY4 with Terkin and BOB firmware and trying to get something working.

I have a collection of beehive monitors from all over the world but none of them meet all my needs but based on my reading so far I think hiveeyes could be the way forward.

So far I have failed to get to something that works well, so I have a few questions that will hopefully get me to a setup similar to what I have read about as the BOB Hat V6 with a backend either on the swarm site or with my own backend.

My Goal:
Remote hive monitoring using a mix of connectivity including WiFi, LORA and if I have to 4G depending on site coverage with Scales, Temp and Humidity as the primary sensors but keen to explore sound in the future. Power will be an issue but I have some batteries and panels to play around with in future.

Skills wise, I can get a PCB made, solder, build a set of scales, load firmware, use VS or Atom to modify settings, but I am unlikely to be able to fault find or write code.

Questions:

  1. Is a V6 BOB-Hat with a Pycom chip a good place to start or do I need to rethink my hardware?

  2. I have so far used LoPy4-1.20.2.rc6-0.10.0-annapurna.tar and LoPy4-1.20.2.rc6-0.10.1-vanilla-squirrel.tar firmwares a base. Is this still the right starting point or do I need to learn some new skills and build my own firmware build?

  3. What configuration should I look to use as the most configurable and flexible and that ideally supports my own backend as well as any activity community data logging?

  4. Is there an up to date date guide (I cannot find one) that can help me in this journey and if not can I help to build / update one if the community can help me get going?

thanks in advance

cheers
Michael
from Australia

2 Likes

Hi Michael, great to have you here at hiveeyes, welcome! Nice to see people from Australia here also!

Just to clarify, we supported the BOB research project and there is a user friendly, via captive portal configurable BOB software. You can find a lot of documentation under Bee Observer Online Dokumentation (only German).

Feature-wise and from a stability perspective the BOB software package was not optimal. So – especially Andreas – developed the Terkin software a replacement of the BOB software, compatible with the PyCom devices and compatible with the other BOB hardware (PCB, sensors, …). Unfortunately Terkin has no captive portal for configuration. So you have to edit config parameters in a text file. The biggest blocker may be the installation of Terkin it’s not so user firendly – for a Windows user – you have to use the terkin sandbox see Setup MicroPython sandbox — Terkin Datalogger 0.14.0 documentation and working with the so called “sandbox” needs a light learning curve. Alternatively you can use the Terkin releases with a IDE of your choice, that would I recommend to start. In case you need later nightly builds or you will modify parts you can still use “the sandbox”.

For the release use the workflow would be:

  • install Visual Studio Code (or Atom)
    I had too much problems with Atom and switched to VS, especially the PyMakr plugin did not run in case a new Atom version showed up.
  • install the PyMakr Plugin to upload code to your PyCom devices
    Pymakr - Visual Studio Marketplace
  • download the Terkin package as release!! do not download the repo / code version!
  • open the code in VSC
  • edit the config file
  • upload to LoPy / xPy

I have not installed Terkin a longer time, so I do not know what a working combination of PyCom’s firmware and terkin software is. But @Andreas has done some work in the last days and has a recommendation?

You can find the Terkin configuration file under terkin-datalogger/src/settings.example.py at main · hiveeyes/terkin-datalogger · GitHub it is quite flexible and can send your data also to swarm.hiveeyes and in parallel to your own server.

1 Like

Clemens,

Thanks for the fast response and clarification that Terkin is the best way forward for software.

I have been able to load the LoPy4-1.20.2.rc6-0.10.0-annapurna firmware before and then use Settings.py to get my test bed scales, temp and humidity to work with the swarm.hiveeyes.org site and have gone back to that today as a baseline to confirm all my test hardware is working.

I am a Mac user and have both VS and Atom with pymakr working so that bit is all ok.

From a release perspective the last image is from May 2020 and is what I already have loaded. I see @Andreas has indeed done some new releases in the last few days but these do not yet include an image so I assume I need to get the sandbox working to create an image or wait for a release?

Cheers
Michael

2 Likes

Dear Michael,

welcome to our community and thank you very much for signaling interest in running Terkin. I also believe it might fulfill many of the goals you outlined above out of the box already. @clemens: Thank you already for answering many of Michael’s initial questions while I was travelling.

I believe this is an excellent basis for approaching the system(s) being developed here and, eventually, for sharing back further improvements from your pen with the community.

We hope to be able to support you on any questions or wishes on this topic.

That’s great news. I am happy to hear you already had success downloading and running the latest official release series of Annapurna firmware images for Pycom/ESP32 devices, currently including Terkin version 0.10.0. You have just been using WiFi for telemetry connectivity yet, right? We will be all ears to hear back from you about any endeavours using the other telemetry adapters for LoRaWAN, LTE-M (Cat M1), NB-IoT (Cat NB1) or GSM (SIM800).

As the Annapurna 0.10.0 release was based on Pycom firmware version 1.20.2.rc6, I would definitively like to look forward to a new Annapurna release, based on the latest stable Pycom firmware release version 1.20.2.r4 and the latest Terkin release (currently 0.13.0).

While most of the recent updates to Terkin were mostly related to CPython, Terkin >0.10.0 definitively contains some gems also relevant to MicroPython you might want to make use of, see [1] ff. So, I hear you on this.

Exactly. Getting the sandbox working will also get you closer to development, will enable you to adjust and extend the code on your own behalf, and get updates to the code base into your hands more quickly. So, if you have at least a slight interest getting this going, why not give it a spin? ;]

Apparently, the most recent documentation is [2]. While this walkthrough has mostly been written for Linux, I am also running the sandbox on macOS, so you might want to directly jump to the “Acquire source code” section there. Please do not hesitate to let me know about any problems you might run into.

With kind regards,
Andreas.


  1. terkin-datalogger/CHANGES.rst at main · hiveeyes/terkin-datalogger · GitHub ↩︎

  2. Setup MicroPython sandbox — Terkin Datalogger 0.14.0 documentation ↩︎

1 Like

Andreas,

Thanks for the warm welcome and offer of support.

Yes wifi only at this stage and LoRa in the future. There is not much coverage yet but there is some planned growth for Helium and Thing Networks. but for now wifi to get it working.

I have tried to setup the sandpit on the Mac but have had a heap of issues so have spun up a Raspberry Pi and have used that to connect via the network to the LOPY whilst also having it connected via Atom serially for edits. I did try the Pi via USB to the Pycom but it did not seem to work well. I don’t think I have all of this configured correctly yet but will keep trying and might try the mac again as well. We have a long weekend this weekend so will have some time to play.

Can I load the LOPY with 1.20.2.r4 and do a make install-ftp using 0.13 and expect it to work? or do I need to stay with older versions for now? I am stumbling through this without really knowing what I am doing :slight_smile:

Back to some of my first questions. Is the V6 Shield a good choice for hardware build or am I better with another layout? I was going to get a couple made up.

Cheers

Michael

Dear Michael

Do you want to make the PCB yourself?

I decided to use a one-sided circuit board for my replicas, as these are easier to make myself.
Meine Entwicklungsplatine für BOB (DIY Ätzen).
The thread is unfortunately in German. Don’t be afraid to use the translation function.

This Board have some diferents to the Hat-V6.
The buttons from the Hat-V6 currently have no function in Terkin. Neither does the optional connectable display. So the structure can also be a little bit simpler.

Otherwise, the layout of the Hat-V6 is a good choice.

With kind regards,
Michael

Yeah, I would expect that to work, right. I will be happy to hear back about its outcome.

Michael

I usually use Osh park or Dirty PCB’s for double-sided boards, but I also have an etching kit so I could have a go to your board. I like the look of the V6 and hope that the OLED will be supported in the future so I think I’ll get a few.

Thanks for sharing your single-sided board

cheers
Michael

Andreas,

Looks like I have a good start. It does seem to lock up after a while but I will spend some more time seeing if I am doing something wrong. Next step is to get a backend up and working and some more sensors on my test bed.

Cheers

Michael

========================
Terkin Datalogger 0.13.0
========================
Device id    105xxxxxxxxx

CPU freq     160.0   MHz
Free heap    133.884 kB
Free PSRAM   261.904 kB

Python  : 3.4.0
platform: LoPy4
lorawan : 1.0.2
machine : LoPy4 with ESP32
nodename: LoPy4
pybytes : 1.6.1
release : 1.20.2.r4
sigfox  : 1.0.1
sysname : LoPy4
version : v1.11-ffb0e1c on 2021-01-12
2 Likes

At that time I mainly made the circuit board to test different setups.

So I can connect 2-4 hx711 or an SD memory card for logging.

Even if it works on its own, it was not intended for productive use.

Do you have any spaces in your SSID? The ESP32 family does not like this and sometimes gets stuck during the audit in the WLAN.

There are different possibilities how to run the Hiveeyes backend. While we are running all software components delivered through Debian packages on our production servers [1], you can also use Docker if you prefer that. Just recently, we gave this setup some love, based on original contributions by @Werner [2].


  1. Setup - Kotori DAQ ↩︎

  2. Running the Hiveeyes backend with Docker Compose ↩︎

Michael,

nope no spaces

Just to be sure to suppor you on the right side: You have problems to connect your device to Wifi right now or is the point an other now?

Clemens,

Connecting on wifi is fine but since moving to latest firmware it seemed to lock up from time to time. I haven’t gone back to figure it out yet, trying to get the backend up first.

Thanks
Michael

1 Like

Just a quick update on a few things.

  • I have just got 3 x BOB Hat V6 PCB’s in the mail so will solder one up this week and fit it out in a weather proof box

  • Wifi stability is all good, I was attributing stability to timeouts on the Atom IDE but the LOPY is rock solid

  • I have had no luck building a test backend on a Raspberry Pi using the standard instructions or with the Docker images due to missing Arm compatible components so have spun up a EC2 Debian server on the AWS free tier and have a Kotori build installed on that. Docker image for the backend in a box did not work on this server either and failed right at the end with some permission errors. I will have another go and document errors for all of this probably this weekend.

  • I have built a H frame Scale ready for pairing with the electronics so hopefully might have a working setup to put on my backyard hive in a week or two.

  • I am expecting a Helium hotspot before the end of October and hope to use that for LoRa connectivity.

Thanks for all the help so far, I am sure I will need more :)

Cheers

Michael

1 Like