Skip to content

Commit

Permalink
Modernize node-terkin-next
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed May 3, 2021
1 parent 6a59258 commit 8dd0b8c
Show file tree
Hide file tree
Showing 11 changed files with 121 additions and 223 deletions.
60 changes: 15 additions & 45 deletions README.rst
Expand Up @@ -21,20 +21,23 @@ README
************
Introduction
************

This is the documentation for the `Hiveeyes Arduino repository`_ of the `Hiveeyes project`_,
a beehive monitoring system. Enjoy reading!

All Arduino Core based firmware source code is living here.
We support different hardware, so there are different flavors
of the firmware, reflected by the directory naming convention
``<purpose>-<transport>-<protocol>``.
There are firmwares for ATmega328_ and ESP8266_ MCUs.

There are firmwares for ATmega328_, ESP8266_ and ESP32_ MCUs.

* ``purpose`` role name, either *node* or *gateway*
* ``transport`` name of the physical transport mechanism, e.g. *rfm69*, *gprs* or *wifi*.
* ``protocol`` name of the transmission protocol, e.g. *beradio*, *mqtt*, *http* or *any*.

Most programs use `Arduino-Makefile`_ for building while there are still some based on Ino_.
For building, most programs are using PlatformIO_, but some are still using
`Arduino-Makefile`_ and even others are still based on Ino_.


*****
Expand All @@ -53,71 +56,39 @@ Get source code with all dependency libraries and tools::
Toolchain
=========

PlatformIO_ is the recommended build environment.

Arduino IDE
-----------
If you want to use the Arduino IDE, you have to install all necessary libraries manually.
The sources of the libraries can be found in the header of each sketch (.ino).
In this case, copy the desired sketch into your Arduino IDE and pick the appropriate
libraries from the ``libraries/`` folder.

.. seealso:: https://www.arduino.cc/en/Guide/Libraries


Debian packages
---------------
::

apt-get install arduino-core
In each programs subdirectory, there is a ``platformio.ini`` which will give you a clue
about the libraries to use.


Archlinux packages
------------------
* aur/arduino 1:1.6.8
* community/avr-libc


Mac OS X Homebrew packages
--------------------------
::

# GNU AVR Toolchain as formulae for Homebrew
# https://github.com/osx-cross/homebrew-avr
brew tap osx-cross/avr
brew install avr-gcc

::

# The Arduino HAL
brew cask install arduino
PlatformIO
----------
When using PlatformIO_, installing all dependency libraries will be managed automatically.


*******
Operate
*******
For operative tasks like compiling, `Arduino-Makefile`_ is in the loop.


Compile
=======
::

cd node-gprs-any
make --file Makefile-Linux.mk
cd node-esp32-generic
make

After a successful build, find the firmware at ``bin/node-gprs-any/pro328/node-gprs-any.hex``.


Upload to MCU
=============
To build a firmware hex file, upload it to the MCU and
finally start a serial port monitor, do::

cd generic

# Prepare appropriate Makefile (use Makefile-OSX.mk on OSX)
ln -s Makefile-Linux.mk Makefile

# Compile and upload to chip
export MCU_PORT=/dev/ttyUSB0
make upload

# Run serial port monitor
Expand Down Expand Up @@ -146,4 +117,3 @@ Documentation
Licensed under the Creative Commons `CC-BY-SA 4.0 license`_.

.. _CC-BY-SA 4.0 license: https://creativecommons.org/licenses/by-sa/4.0/

1 change: 1 addition & 0 deletions doc/source/firmware/node-terkin-next
7 changes: 3 additions & 4 deletions doc/source/firmwares.rst
Expand Up @@ -178,11 +178,10 @@ The next generation firmwares are currently a work in progress.
* - Name
- Description

* - node-gprs-any
- We started working on `node-gprs-any.ino`_, a playground sketch
* - node-terkin-next
- We started working on `node-terkin-next.ino`_, a playground sketch
for building a generic transmitter machinery in June 2016.

* - :ref:`generic-firmware`
- We started working on `generic.ino`_, a flexible software breadboard
for nodes, transceivers and gateways in June 2016.

for RFM-based nodes, transceivers and gateways in June 2016.
2 changes: 1 addition & 1 deletion doc/source/resources.rst
Expand Up @@ -31,7 +31,7 @@
.. ----------------------
.. Source code
.. _node-gprs-any.ino: https://github.com/hiveeyes/arduino/blob/master/node-gprs-any/node-gprs-any.ino
.. _node-terkin-next.ino: https://github.com/hiveeyes/arduino/blob/master/node-terkin-next/node-terkin-next.ino
.. _node-rfm69-beradio.ino: https://github.com/hiveeyes/arduino/blob/master/node-rfm69-beradio/src/node-rfm69-beradio.ino
.. _gateway-rfm69-beradio.ino: https://github.com/hiveeyes/arduino/blob/master/gateway-rfm69-beradio/src/gateway-rfm69-beradio.ino
.. _generic.ino: https://github.com/hiveeyes/arduino/blob/master/generic/generic.ino
Expand Down
1 change: 0 additions & 1 deletion node-gprs-any/.gitignore

This file was deleted.

82 changes: 0 additions & 82 deletions node-gprs-any/Makefile-Linux.mk

This file was deleted.

84 changes: 0 additions & 84 deletions node-gprs-any/Makefile-OSX.mk

This file was deleted.

15 changes: 15 additions & 0 deletions node-terkin-next/Makefile
@@ -0,0 +1,15 @@
$(eval venvpath := .venv)
$(eval python := $(venvpath)/bin/python)
$(eval pip := $(venvpath)/bin/pip)
$(eval pio := $(venvpath)/bin/pio)


build: setup-virtualenv
$(pio) run

upload: setup-virtualenv
$(pio) run --target upload --upload-port=${MCU_PORT}

setup-virtualenv:
@test -e $(python) || `command -v virtualenv` --python=python3 $(venvpath)
$(pip) install platformio
35 changes: 35 additions & 0 deletions node-terkin-next/README.rst
@@ -0,0 +1,35 @@
###################################
Firmware based on Terkin-Next (WIP)
###################################


*****
About
*****

A study to bring the "Terkin Datalogger for MicroPython" to C++.

- https://github.com/hiveeyes/terkin-datalogger
- https://community.hiveeyes.org/t/nexterkin-terkin-c-portierung/3577


*******
Details
*******

- The configuration domain has been sketched out by @marcelgasser.

- https://github.com/marcelgasser/nexTerkin/tree/spike_configmgr

- The telemetry domain has been sketched out by @amotl.

- https://github.com/hiveeyes/arduino/tree/master/node-terkin-next
- https://hiveeyes.org/docs/arduino/TerkinData/README.html

- The sensor domain might be implemented on top of the EnviroDIY
ModularSensors library. It is a library to give environmental
sensors a common interface of functions for use with Arduino-
compatible dataloggers.

- https://community.hiveeyes.org/t/envirodiy-mayfly-data-logger/3035
- https://github.com/EnviroDIY/ModularSensors
@@ -1,15 +1,13 @@
/*
Open Hive node-gprs-any
Open Hive Terkin Next
Collect sensor data, serialize as JSON and send it through GPRSbee.
HTTP is preferred, however FTP, SMS, TCP and MQTT will be at your service.
Software release 0.16.0
Copyright (C) 2015-2016 Andreas Motl <andreas.motl@elmyra.de>
Copyright (C) 2015-2016 Clemens Gruber <mail@clemens-gruber.de>
Copyright (C) 2015-2016 Richard Pobering <einsiedlerkrebs@ginnungagap.org>
Copyright (C) 2015-2016 Clemens Gruber <clemens@hiveeyes.org>
Copyright (C) 2015-2016 Richard Pobering <richard@hiveeyes.org>
Copyright (C) 2015-2021 Andreas Motl <andreas@hiveeyes.org>
<https://hiveeyes.org>
Expand Down

0 comments on commit 8dd0b8c

Please sign in to comment.