Using RuuviTag with Espruino following FW v3.31

Hello,

I think my issue actually targets the use of new RuuviTags with Espruino, when Espruino is no longer supported:

My RuuviTag used to work fine with Espruino, but at some point it would no longer get connected to the Espruino Web IDE. I wasn’t able to perform a DFU, but I used a DevShield and Nordic’s nRF Connect Programmer, and I could flash it with FW v3.30_full.hex. This worked fine with the Ruuvi Station on Android - I was able to see measured data and also to perform a DFU to v3.31. All fine.
But then I reflashed it, again using the DevShield, with espruino_2v06_ruuvitag. I can connect to it using nRF Connect general tool; the Espruino Web IDE also can pair with is, but it doesn’t connect - I just get a Connection Failed message. Same behavior with espruino_2v04_ruuvitag, 2v05 and 1v99.

My questions are:

  • If I buy new RuuviTags, which come with FW v.3.30, and I will want to use them with Espruino (flashed using DevShield), will this work?
  • Can this also be solved for my current RuuviTags? (I actually have two).
  • A side question: how can I find out the HW version of my RuuviTags? All I can see on them is STM-5, 94V-0, E207844, and 18 18. I bought them a few years ago.

Thank you,
Andrei

Hello,
for the question about the HW version:
When you open the RuuviTag, on the bottom PCB side there is small marking which tells you the hardware version.
All versions can be found here: GitHub - ruuvi/ruuvitag_hw: RuuviTag hardware projects

Thanks, Chris. So it’s B6.

Hello Chris,

We have updated sensors in new RuuviTags, B6 has BME280 for temperature, humidity and air pressure while B8 has SHTC3 for temperature and humidity and DPS310 for air pressure.

I do not know if Espruino would support the new sensors, and the default RuuviTag Espruino FW does not have the sensor support as far as I know so porting the new sensors would be needed.

The Bluetooth and accelerometer functionality should work on B8, but the unsupported sensors would draw a lot of power leading to a short battery life.

I don’t know why the Espruino Web IDE would fail with the connection if you can pair to the tag. Maybe the Web IDE needs some feature that is present only on later Espruino FW revisions?

Hi,

I have a follow-up comment / question - I can get Espruino to run on B8 hardware by flashing with the devkit, but can’t initialize the accelerometer - I get an “Uncaught LIS2DH12 WHO_AM_I check failed” in Espruino. This works on B7.1 but not on B8:

var Ruuvitag = require("Ruuvitag");
Ruuvitag.setAccelOn(true);

I think this might be an SPI issue, as the following fails with WHO_AM_I check on B8 but works on B7.1. However, I get the same error on B7.1 if I change the SPI setup to something wrong (e.g., mosi: D26).

var spi = new SPI();
spi.setup({ mosi:D25,miso:D28,sck:D29 });
var acc = require("LIS2DH12").connectSPI(spi, D8);

Any hope to get this to work in 2023? Or can you point me to some other dev environment for experimentation? The old blog post GitHub - ojousima/ojousima.logger.c at acceleration_streamer is very close to what I need but I can’t get the code to build with Segger, as the environment, SDKs etc have changed a lot since 2018. And the learning curve to building an nRF project from scratch in Segger is quite steep.

  • Jussi

Hello,

My first guess is that LIS2DH12 is unpowered on B8 board. We added GPIO power control to sensors to prevent unused sensors consuming power unnecessarily.

You can find the schematic at ruuvitag_hw/ruuvitag_revb8_schematic.pdf at master · ruuvi/ruuvitag_hw · GitHub.

Set P0.07 to OUTPUT_HIGHDRIVE and HIGH, that should fix your issue.

Thanks a million!

In Espruino I use D7.set() before using Ruuvitag and now the accelerometer works. I couldn’t find how to set the output to high drive mode in Espruino, but at least at whatever the default g scale and reporting frequency are I can read the values.

  • Jussi