Just some quick notes on gettings started with your HiMinds Open Source Wireless Environmental Sensor

Suru Dissanaike
HiMinds
Published in
4 min readDec 12, 2019

This article will describe how you get started with your HiMinds Open Source Wireless Environmental Sensor; you will be doing the following:

  • Download code from Github
  • Install the development environment
  • Build and flash code
  • Test your hardware

The source code

First of all, we need to clone the git repo:

git clone https://github.com/HiMinds/himinds-boosting-innovation-embedded-env-sensor-sw hm-envcd hm-env

Unpack and connect accordingly

Time to have some fun!

A board and the battery.

Connect the battery to the board.

Just use a standard Micro USB cable, like the one that is used to charge an Android Phone.

Connect the hardware to your computer.

Install the development environment

Download and install the mos tool.

For generic MacOS/Linux installation

curl -fsSL https://mongoose-os.com/downloads/mos/install.sh | /bin/bash

Close the terminal and open a new terminal and run:

mos

Note: mos starts the UI in a browser window.

In macOS the HiMinds Env pops up as /dev/cu.usbserial-14120, as seen below:

In Ubuntu 18.04 it popped up as /dev/ttyUSB0.

Before you plugin the HiMinds Env it is wise to add your user to the dialout group. It will give your user access to the serial port.

sudo usermod -a -G dialout $USER

You need to logout and login again when you have executed to command above. Restart mos tool, disconnect/connect HiMinds Env sensor before you start mos tool.

In the mos tool cd to the directory that you cloned the repo.

Type

mos build 

When the build is done it will look similar to this in the mos tool:

mos build — platform esp32 Connecting to https://mongoose.cloud, user test Uploading sources (2914 bytes) 
Firmware saved to /Users/sudi/Desktop/git/hm-env/build/fw.zip
mos build — platform esp32 Connecting to https://mongoose.cloud, user test Uploading sources (2914 bytes) Firmware saved to /Users/sudi/Desktop/git/hm-env/build/fw.zip

Type

mos flash

And the code will be written to the HiMinds Open Source Wireless Environmental Sensor. The device will automatically reboot when the flashing is done.

$ mos flash First run of the version 2.16.0, initializing… Init done. Loaded hm-env/esp32 version 1.0 (20191211–190710) Opening /dev/cu.usbserial-14120 @ 115200… Connecting to ESP32 ROM, attempt 1 of 10… Connected, chip: ESP32D0WDQ6 R1 Running flasher @ 921600… E1211 20:40:18.645172 44933 common.go:73] failed to run flasher @ 921600, falling back to ROM baud rate… Opening /dev/cu.usbserial-14120 @ 115200… Connecting to ESP32 ROM, attempt 1 of 10… Connected, chip: ESP32D0WDQ6 R1 Running flasher @ 0… Flasher is running Flash size: 4194304, params: 0x022f (dio,32m,80m) Flash encryption: disabled, scheme: None Secure boot: disabled 
Deduping…
22848 @ 0x1000 -> 6464
3072 @ 0x8000 -> 0
16384 @ 0x9000 -> 8192
8192 @ 0xd000 -> 0
982464 @ 0x10000 -> 810432
262144 @ 0x190000 -> 77824
Writing…
4096 @ 0x1000
4096 @ 0x6000
8192 @ 0x9000
4096 @ 0x10000
4096 @ 0x12000
188416 @ 0x14000
57344 @ 0x50000
4096 @ 0x62000
245760 @ 0x64000
77824 @ 0xa6000
20480 @ 0xc2000
57344 @ 0xc8000
106496 @ 0xd8000
45056 @ 0xf5000
77824 @ 0x191000
Wrote 902912 bytes in 60.15 seconds (117.28 KBit/sec) Verifying…
22848 @ 0x1000
3072 @ 0x8000
16384 @ 0x9000
8192 @ 0xd000
982464 @ 0x10000
262144 @ 0x190000
Booting firmware… All done! Command completed.

Now you are done, the log window should show something similar to this:

[Dec 11 20:49:29.199] Voltage:  4.171000 
[Dec 11 20:49:29.205] Celsius: 24.050000
[Dec 11 20:49:29.212] Full Available Capacity: 1.255000
[Dec 11 20:49:29.223] Remaining Capacity: 1.094000
[Dec 11 20:49:29.245] getBQ27441Info message: {"data":{"remainingCapacity":1.094000,"fullAvailableCapacity":1.255000,"batteryLevel":100,"temperature":24.050000,"voltage":4.171000}}

Thank you for reading! Take care and hope to see you soon. 🙏🏽

This article is a living document please reach out to me if you want to contribute or see anything inaccurate here. This article is part of our “Boosting Innovation” project.

--

--