MQTT – Finally

Finally able to Subscribe and Post Data to a MQTT broker/server.

As always, examples found on the internet, are incomplete, or are just copies of someone else’s post. One of the most popular examples has both Post and Subscribe in one, but of course doesn’t really work without a great deal of review.

Basically you have a server, what they call a broker, that receives all the MQTT traffic., then it allows others to subscribe and monitor the data being posted.

So my setup has a rtl_433 receiver that collects all the sensor data from 433 devices and parses it. Sensors include weather stations, remote temperature, door switches and motion detectors. At present all I am handling is the temperature sensors. Each sensor has an ID which I track, noting it location on the property. Then they also have temperature (of course) and humidity. The sensors sends a lot of other data, but that is all I really need. I then send the data back to broken parsed, into another channel for my use..

The coal is to parse the incoming data into a control panel that will display sensor data, like a dashboard. Basement sensor always in same location, for example. Graphically.

Sensor appear to just send data in a timed manner, once every few minutes. They don’t care if anyone receives it, just throw out over the airwaves. The SDR receives the data, parses it, the Posts to the Broker. The Broken in turn basically doesn’t the same thing as the sensor, it just rebroadcasts the data for anyone that has Subscribe to that Topic. My webpage Subscribes to the Topic and reparses the data and displays it.

Getting there!

MQTT – How simple …

Was able to add MQTT server using Mosquitto, as simple as they attempt to make it sound to setup and operate, it isn’t.

Using BREW to installed sounded simple, but never worked as all the instructions I could find. Doing a mix install using Brew and other installers I was able to get it working. You couldn’t just start and stop the service thru Brew you had to Force Quit using Activity Monitor, then use:

/usr/local/sbin/mosquitto -c /usr/local/etc/mosquitto/mosquitto.conf to restart.

Adding users was confusing but after a few tries I got it working.

mosquitto_passwd -b passwordfile admin mqttadmin1

Monitoring the server was make very easy using MQTT Explorer, thought understanding the data was a bit more of a challenge. Couldn’t tell when of of my devices was online or not, till about the 15th try. The it just showed up and started working.

My first device was a weather station by Pimoroni:

Having purchased the sensors a few years ago from SparkFun. When I finally saw the sweet data appear I was overjoyed.

{
“device”: “nature-weather”,
“pressure”: 951.99,
“temperature”: 25.8,
“humidity”: 42.61,
“wind_direction”: 90,
“light”: 334.98,
“rain”: 0,
“timestamp”: “2022-08-21 15:51:03”,
“wind_speed”: 0
}

My next project is using Red-node to display the data as it is published to my broker (Can’t understand why they don’t just call it a server).

OH a note about Red-Note, don’t attempt to use Safari on a Mac, it doesn’t work. (See Photo Below) Wasted half an hour thinking i needed to install Modulars or something. Tried in chrome and it opened right up. Apple is become a real pain, IMHO.

Nature-Weather and Nature-Cam

Problem with Safari on Right VS Chrome on Left

Reducing number of domains.

Over the years we have acquired a few domain names we thought we’d end up using someday. Some have gone up and value others have not.

So we’ve decided to start cutting down on the number of domain names we have and better combine those we want to keep.

LittleSoftwareBarn.Com is our ‘see us, see what we’ve done’ site.

LittleSoftwareBarn.Net is our locally hosted domain and allows us to interact directly with our internet of thing using local systems.

Other sites that were purchased thinking they would fit a future need, are being let go.

Sites we see as investments, in the name, are being kept.

We will be keeping http://travelingmickey.com it seems very popular, lots of visitors.

And N4N.us we will keep, because we like the WordPress blogging system.

RapidWeaver

Got my first real job in web development in over a year, which was good. Had to spend a few days attempting to fix a coding issues that ended up being a hosting issue. It is all good now, finished way ahead of due date. Added lots of features the client didn’t expect. All and all, RapidWeaver is a time saver and great tool for both big and small jobs.

The Cloud – Really!

Just thinking:

After watching the development of “The Cloud” as a marketing tool for software companies, I’ve decided it is a con, a way for the developer to control the user and milk them for more money.

There are a many ways to utilize “The Cloud” the two major ones are as a personal storage space like DropBox, OneDrive (and its many incarnations) and iCloud, and then there is the way Nest and many many Phone apps developers  store your data on their servers for ‘security reasons’. Which is just a nice way of saying, oh yeah, we will charge you an unnecessary amount each month to use their app. After you have a few of these apps, the monthly charges really add up.

What happened to Individual Cloud storage, putting your own NAS on the internet and using that? (Hint: Most users don’t hold the skills to setup, no offense), or their ISP makes it almost impossible.. So everyone has to pay more for less.

 

Outdoor Sensor Array


How many sensors can we plug into one Arduino and setup outdoors? This is how many I was able to cram into one Project Box.

The system uses a ESP8266 Wifi / Arduino Card with a screw terminal Shield. — I attempted to run it all with two 12 volt solar panels with a solar charger. Didn’t have enough juice, so ended up just plugging into outlet located outside.

Hardware

Screenshot 2016-03-06 12.32.51