Is It Possible connect to Balenacloud without BalenaOS?

I am working on a project that does need a display screen on my Raspberry pi. It is running a Adafruit Feather M0 with a Multiplexer that has multiple AM2315 Temp/Humidity sensors attached. Currently the Pi creates a hotspot, that the Feather M0 connects too. After the connection it sends data to the Raspberry Pi’s SQL Database, which in turn is displayed on the Pi’s HDMI display, through Grafana. The Pi 4, is then connected to a router via Ethernet for local time, ssh etc. I would also like to send this data to my BalenaCloud account. Yet sadly I have not been able to find a way to connect the pi via docker or just send data from the Feather M0 without having BalenaOS. Is there a way I could do this, or better yet update and add features that would allow me to do both?

Any Help would be greatly appreciated

balenaCloud does not save any data. If you want to graph e.g. values from your sensor, you need to use solutions like Thingspeak.com or similar. balenaCloud just makes it easier to deploy your RPi in the field and maintain the running containers. But - as you said - you need to use balenaOS for that, as connecting to balenaCloud involves VPN settings and more which are not openily available, but are integrated in your specific images.

The way to do this would be to create a new fleet in balenaCloud for your project, add a device (e.g. RPi 4), download the prepared, fleet specific image and flash your RPi. Then create images for all functionality (like e.g. database) and deploy them to the RPi. I have not yet used an balena RPi AP - but I guess there is some project to achieve that as well.

1 Like

Yea I have kind of found that out last minute. Never created a docker image prior to this. It’s for a business I am working with. They currently are using BalenaCloud. It’s the sensors they have right now is just for real time data, without using a database for history. I’m kind of in a learn really fast mode right now. The main boards are already out a nd deployed linking to my server, but they want it on their account running balenacloud.

I guess what I really need to know is, if there a container that I can throw on an existing Debian OS that will talk to BalenaCloud. That way it keep my current setup, and I just send data on both ends.

No, that is not possible. You need to integrate it correctly as laid out, sorry. And I am not really sure to what end do your partners use balenaCloud? To access the RPi via Webforward? Or to restart the RPi? Something like that?

1 Like

shit, thats ok. I guess I’m rewriting the sensor data in python rather than cpp. They use it for monitoring seed containers, why they chose to use this end, is beyond me.

Sorry for being the bearer of bad news. Yeah I completely feel that, sometimes some decisions are beyond understanding. While C/C++ is excellent for sensors, Python will probably get you faster to the goal - especially if you easily want to integrate into other system, e.g. databases and such. And if you’re “just” monitoring low frequency sensors (not doing something like ABS systems for cars or other security relevant things with some 100 Hz sensors data rate) thats more than enough. If I understand correctly your (internet connected) RPis are used to monitor some sensors and then hold this data in some database at some point. I don’t know if you heard of MQTT (especially the variant Mosquitto) - but its extremely simple to implement, does plugin into Python and would make your project probably smaller - meaning you could use the RPis to “harvest” the sensor data and send it via Internet over MQTT to your central database (and maybe graphing system - you can connect to MQTT via Telegraf, Telegraf plugs into InfluxDB and InfluxDB can be graphed in Grafana). Just some two cents because of drinking too much coffee. Sorry. All the best for your project!

2 Likes

I have heard of MQTT. It’s not a huge issue, I just need to buckle down and redo some of the code I wrote. Not fully use to using containers. I will just have to do some more reading and dig deeper. As far as C/Cpp goes, I enjoy writing in it, I’m a little rusty on python but this will be a good refresher for me. Nothing wrong with expanding your knowledge. I already spent most of yesterday making sure the current multiplexers would work well with RasPi and Python. Took some time reading forums to fix the issue I was having.
Thank for giving me an update on what I could and could not do with Balena. The System is interesting, I really only knew about it from the extensive use of Etcher.

1 Like

You’re most welcome - come back to the forums if you ever need some support - or - if possible, you could also promote your project in the Show and Tell area ( Show and Tell - balenaForums ).

Take care :slight_smile:

3 Likes

I actually took some time to study how the system works, I got everything working with a docker version of everything needed to talk to my microcontrollers. The only thing that I haven’t fix yet is the small display. If there is a will there is a way.

Keep us updated with your advances!

1 Like

Having never used BalenaOS and very little use of docker. What I did was recreate my setup on linux via docker. MariaDB, PHPMyAdmin, Grafana, Apache2 and turning my Raspberry Pi 4 into a Access Point that is hardwired into the router. Doing this, it allowed me to send readings to the MySQL database from an Adafruit Feather M0 WiFi while also giving the user a graphical interface to view and log the data while active.
For Grafana the settings are saved inside the via external storage. Saves me from reconfiguring the setup, JSON files for Grafana and reloading the MySQL location.
The next step is sending out the MySQL readings in BalenaClouds Dashboard. Most of what I did was write scripts to auto create MySQL database, tables, and columns and PHPMyAdmin login info.

@john.evolve did you make this run on balena finally?

Yea, everything now is running on BalenaOS. There a few minor things I need to add. But everything is o Balena now.

Nice work on this one @john.evolve – the value proposition for balenaCloud is scaling. So, now that you have the workload / application containerized, you can actually replicate that out to any number of devices deployed in the filed.

1 Like

Yup, I actually posted the source code and setup on GitHub. You are more than welcome to check it out and use it to f you would like to.

Hey @john.evolve this is a really cool application! Would you like to share it on the balenaHub?

On the other hand, did you try to use balenaBlocks? I’m looking forward to learn more about your feedback about them → Introducing balenaBlocks: jumpstart your IoT app development

Let me look into balenaHub, Personally wouldn’t mind sharing it on there. And no I didn’t use balenaBlocks. Been a little tied up with a few new projects.

Here is the link, I made my Fleet public with the source code.

1 Like

This is super cool @john.evolve

let me try this :slight_smile:

1 Like