Author Archives: Xose Pérez

About Xose Pérez

I've spent half my life working with computers creating virtual products, now I've moved to the physical part of it, much more fun!

RF power monitoring tools on the cheap

Recently we at @ttncat had to prepare a crash course on LoRa, LoRaWAN and The Things Network for a professional school in Barcelona. It was a 15 hours course that covered from the very basics to some more advanced topics on RF like link budget, attenuation or impedance matching. It was fun to go back to my years at college and revisit and update some of those topics. And at the same time it was a great opportunity to upgrade my toolbox.

I’d like this to be the first of a series of posts about radio frequency. Talking about tools and devices I already had and some of the new ones I now own. I think they might be of some interest for newbies and makers since -due to my budget- they tend to be low cost devices. At least I hope you will find it interesting to know they exist.

I don’t pretend to write these posts in any specific order but I’m just starting with what I feel is one of the most basic concepts, and it’s that a radio device outputs energy. So maybe one of the first questions is “how much energy?“.

RF Power

So RF power monitoring is the first step to analyze how a certain radio sends data by quantitatively measuring how much energy it outputs. You probably know this is called “power” and power is measured in Watts (W). Radio Liberty (a CIA-founded organization meant to broadcast anti-comunist propaganda) had a facility in Pals, Girona, from where they could reach as far as Moscow. The facility consisted on 6 radio towers with an overall output of 1.5MW (that’s megawatts).

Continue reading

Automated unit testing in the metal

Unit testing your code is peace of mind. It has two main direct benefits that impact on your confidence about the code you are writing:

  • Testing expected behaviors
  • Avoiding regressions (i.e. breaking something that was working fine before)

Unit testing embedded systems is a bit more involved since there is the additional constraint of the hardware itself, sometimes more than one device or even different platforms. Quitting (or not even thinking about it) is the easy answer to the problem. All of us have debugged expected behaviors with inline prints. But automating some of these tasks have a huge benefit on the code quality and development speed.
Continue reading

Monitor your TTN gateways with Node-RED

This time I’d like to write a quick post about a small project we’ve been working on at the The Things Network community in Barcelona (@ttncat). We were worried about the monitoring of the gateways we have deployed, both as a community but also as individuals. Some of our partners have also deployed their own gateways and they are part of the community.


So how do we get (almost) real-time notifications of incidences in the local TTN network? We want to be able to track them as soon as possible and open the proper ticket in our management system to solve them if the solution is in our hands or notify the entity responsible for the gateway.

Continue reading

WhiteCat ESP32 N1

I do not do reviews usually, but I sometimes do exceptions. In this case, it’s worth doing it, due to 4 main reasons:

  • It’s a software & hardware open source project
  • It’s local (local to me, that’s it)
  • It’s led by two good friends
  • It’s related to LoRa and The Things Network
  • It’s awesome!

OK, they were actually 5 reasons, but the last one just slipped in.

Continue reading

Useful notifications from your home appliances using Node-RED

Some time ago I worked on a home project to get a notification when my washing machine had done its job based on monitoring its power consumption. There was a good reason for that, the machine was outside the house and I had already forgotten about the laundry several times. And when that happens your only option is to wash it again, because it really smells musty…

Monitoring your appliances

Use ESPurna 🙂

OK, there are different ways to get the info about power consumption. But since we want to be able to process the data ourselves most commercial products won’t be suitable unless we modify it.

Alternatively, those that use radio communication to send data from the meter to the base station might be suitable for a man-in-the-middle hack. For instance, if you own an Efergy power meter you must know you can sniff the data it sends using a simple RTL-SDR dongle.

But for most cases, your best chance is to get your hands on a commercial product with an ESP8266 chip in it and change the firmware to suit your needs. You can write your own or use an existing firmware like ESPurna, that already supports a bunch of power metering smart switches.

What info do you need?

The idea is to report (via MQTT) power data from each individual appliance very minute. You can then use Node-RED along with InfluxDB and Grafana (or Graphite) to receive, persist and graph your data like in the image below.


Continue reading