Welcome, Guest
Username: Password: Secret Key Remember me

TOPIC: Pi Zero Wifi / STM32F103CBT6 Project Node Servers

Pi Zero Wifi / STM32F103CBT6 Project Node Servers 3 months 2 weeks ago #18011

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 431
  • Thanks received: 45
OK, the I2C on the ESP8266 is bit-banged and has a limit of 400k speed. Not a deal breaker at all, but I want to try the ESP32S REV 1 in this and see if I get faster speed with the hardware I2C. There are some other bells and whistles with the ESP32S REV 1, like an integrated temp sensor, hall sensor, and 2 more GPIO. Also it is faster and has a dual core. The dual core usage however needs to be set up and utilized specifically, so there is some research to do.

It fits into the budget though, of keeping the cost at or under $20 for the whole system. I have to say that I am impressed with the libraries available that control my SSD1306 128x64 OLED displays. It's faster, or seems that way, allows for functions to control screen "tabs" with an overlay function in real time. We will see how these boards do when they get here Saturday.

So it's back to work on the I2C communications. First test project will be to control a 3.3v rail via MQTT, take light, temp, and humidity sensor readings, and test firmware updates over wlan. Parallel testing will be to see how much I can do with the ability to serve web and how snappy a web interface will be, or if I have to handle all that on the home server. 4mb of flash with no restrictions from the development software, like Keil has, is a lot for an embedded device. There should be a lot of room for autonomy.

More when I know it. Time to get to work! :)

Pi Zero Wifi / STM32F103CBT6 Project Node Servers 3 months 2 days ago #18014

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 431
  • Thanks received: 45
Well, back from an unexpected hiatus... real life medical issues with my wife put us in the hospital for 9 days fighting a blood infection. We are back home now and although she's still on home-care IV's, it is only for another 5 days then we are hopefully past it. While I stayed with her in the hospital, the gracious people at the hospital allowed me to set up tech there, and I had a wired and wireless LAN running with my home server in the clothes closet. So I was able to get some tech work done during our stay, and it was very illuminating!

Using a mobile clothes dresser as a desk, I used the drawers to set up the cabling. So I had a USB3 powered hub in the top drawer and a little test bench for the devices. It worked very well!

I decided to step back to the ESP8266 from the ESP32. There was just too many hoops to jump through with the new ESP32 and I honestly did not need all that horse power anyway. On the ESP8266, I was successful (with Arduino IDE) at incorporating functionality for wireless connectivity, SSD1306 OLED display control, WS2812B indicator LED control, MQTT access, and I2C to my STM32F103C8T6 board (blue pill). It all works very well but I realized how dusty my MQTT web interface is, and my skills at cleaning that up. Setting up that development environment proved to be quite a diversion but it is on track again. The software I wrote for the ESP8266 proved to be so productive that I might actually consider using it along side an arm-linux board again. I really want my nodes to be autonomous, and the ESP is so burdened already, I do not believe that is viable. It is communication between the linux IoT and the ESP8266 that is the stumbling block right now though. And both are capable of WiFi so there is wasted resources there. I am shopping for a solution. Maybe I will just create my own bit-banged protocol to transfer data, but I really liked the DMA supported I2C in hardware. It is hard to let go of.

That's where I am at right now. Trying new things and trying not to get too caught up in tech shifts with the hardware.

I keep heading back to the BeagleBone Black as the node server. It's just so expensive to use it in all my nodes. I will figure something out. Maybe the mini version of it, but that is still pricey.

More when I do it.

Pi Zero Wifi / STM32F103CBT6 Project Node Servers 3 months 16 hours ago #18015

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 431
  • Thanks received: 45
Hi All!

Hope your Thanksgiving day was extra special!!

Now in this project, I have to take a side-road to make things easier for web interfacing with my IoT projects through my node servers. I have been using "THE" Mosquitto broker in Debian Linux, but I am looking to change the way I handle access through a web interface / client. I found a few solutions using Javascript which I am impressed with. I just need solid functions to tell my web interface if I am connected to the broker, reconnect if I am not, and handle scripted communications based on a database stored profile. I guess you could call it Managed MQTT.

Also looking at a variety of hardware to make my "Node Servers" actually mini servers. Problem is, the most capable and powerful IoT systems support HDMI and other all-in-one computer solutions. I would rather not have all that fluff since my server setup is headless. It would be nice to have gigabit LAN and USB3, but realistically, I just need a fast wifi connection and hardware supported I2C and SPI. The search continues...

Pi Zero Wifi / STM32F103CBT6 Project Node Servers 3 months 16 hours ago #18016

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 431
  • Thanks received: 45
UPDATE:

Looking hard at the NanoPI Neo Air with 32gb eMMC. If I can get Debian Linux running on this little guy, it would be a perfect solution to my node server project. Again though, I already have wifi and the other stuff solved. I just need a linux headless server running that does not need connectivity other than something SPI. The search is narrowing! :)

Pi Zero Wifi / STM32F103CBT6 Project Node Servers 2 months 4 weeks ago #18017

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 431
  • Thanks received: 45
Finally! A couple victories!

While I wait for a couple of linux IoT boards to show up for testing, I decided to go after my aging MQTT strategy. I was in such a hurry to test it a couple of years ago that I never got around to cleaning it up. Then I realized that I was trying to control the whole thing with a web interface. That of course is a big mistake. The control and data gathering should be the work of python scripts or even processes, with a watchdog process to restart it if it fails. The data is then fed to a simple database that can be accessed by the web interfaces. The interfaces can still immedietly control the projects through the server nodes, but history data can be accessed from the database. It's simple and clean!

I found a nice example of what I wanted to do but it took a few hoops to jump through to get it to work. I also had to port the code to python 3 standards, and make a few modifications to suit my needs, but it works beautifully! I decided that MySQL was a bit too heavy for what I am doing, so I decided to try out SQLite. I fell in love right away! SQLite does not need a process running to function, and it keeps all the data in a locally generated DB file that can be copied, backed up, etc. There is even a nice open-source Windows program that allows access and editing features to the DB file. PHP supports it, and even javascripting to some degree.

Most if not all of the python side will be hard coded for now. I will gradually replace some of the hard coding with database support for configuration of the system. I am hoping that some sort of in-house standard will emerge from this process, where a new project and server node support can be added then configured through a web interface through a database.

Another victory was my edit of the ESP8266 PubSubClient.h file to allow larger payloads. For now, up to 256 bytes. That is more than enough to transport status, variables, data, and commands.

Thanks for listening!

Pi Zero Wifi / STM32F103CBT6 Project Node Servers 2 months 3 weeks ago #18018

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 431
  • Thanks received: 45
UPDATE: OMG!

I am having so much fun with this project!!! On the ESP8266 side, the head of the node servers (for now), I pulled out my NTP time syncing code and went with a simpler library, EasyNTPclient. Now with hooking via callbacks, I can get into some of the process and get info if an NTP update failed. If so, I can attempt again up to a certain amount of times. Also added was auto DST and TIMEZONE calculations. I have not added any GPS support as of yet because I have not needed to. But I can envision the need for it in the future. After all, it would be useful to know the location of a server node for location mapping in my network. I will explore this much later, so for now I will just see if I can get GPS coordinates over ethernet. I am just using it for auto DST and TIMEZONE adjustments anyway.

I also added support for OneWire and physically added a temperature sensor, a DS18B20. It works beautifully!!! With all this added functionality, I need to work on a "frame" for my OLED display that shows scrolling boot up messages. I do not want to get too deterred into that feature, so I will just spend a couple hours on it for now. I also cleaned up the serial messages and working on a function that makes those available via MGTT so the hive mind (so to speak) can see those messages too, in real time.

This is fantastic fun with some really cool inexpensive hardware and I'm a kid in candy land!! I will have to spend some time documenting the progress and add media to that as well. I will be posting some code and images soon. FINALLY!!

FINAL NOTE: I happened across a github library that allows a device to act as a OneWire slave!! I had not even thought of that! If I can do this reliably, it might prove to be a replacement for my I2C approach talking to the slave project. I need to research range of the connection, buffering and conditioning, etc. It is worth looking into!

Also, I did an accounting of all the projects I want to deploy, and it numbered over 30 devices. I have enough middlemen (STM32F103C8T6) boards, but that is a lot of ESP8266 boards. I need to look at scaling the ESP8266 part down, maybe to a board of my design. I have a number of them in different flavors. NodeMCU 12E boards, ESP-01 boards, and 12E modules without being attached to the development boards. I need to make sure I can support OTA firmware updates no matter how small I scale down to, and how to do that to slave MCU platforms as well. I have a feeling the fun will end and this will get much harder in the near future. I will have to design different levels of node server support as well based on needs. Maybe develop a rank protocol, with actual linux IoT devices per a set number of simpler nodes. Through MQTT, they will be able to support nearby nodes anyway, with ease, and that will keep the overkill and costs down.

It's happening though! Coming together after so much time at it! I'm so excited!
Time to create page: 0.242 seconds