Welcome, Guest
Username: Password: Secret Key Remember me

TOPIC: Pi Zero Wifi / STM32F103CBT6 Project Node Servers

Pi Zero Wifi / STM32F103CBT6 Project Node Servers 2 weeks 3 days ago #18005

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 418
  • Thanks received: 45
I am finding that the RPI Zero Wifi with it's bells and whistles is not very good for this project. Although the specs say that the I2C clock can be manually configured, it always reverts to 400k. That is the reason for the 400k selection by me at this time. I'll find a way (maybe) to fix that. Also, setting it up to communicate with the I2C hardware is a major PITA for sure. I am almost considering using a ESP8266. I have enough of them for sure. That means that the database and web interface will have to be hosted by the home server though. Not sure if that is a big deal.

The BeagleBone Black is a bit better at I2C and control over the hardware is deeper and more versatile, but the cost of that board is preemptively expensive. Where the RPI Zero W is $10, the BBB is what... $60 now? The foot print is also considerably larger although it still fits in my deodorant case. I would have to take care to isolate the STM32F103C8T6 to prevent shorts. It also does not sport WIFI without a dongle, so it really is back to square one.

Finally, the BBB has a ton of power management control where the RPI has very little, and extra circuitry is needed to offer safe on/off. There are watchdog features, and I will have to explore that also to have a safe autonomous server system I can rely on when the power goes buggers.

Anyway, my STM32F103 is responding to address checks from my bus pirate, but my scope shows no activity from the RPI. Something is blocking it again I am afraid where it was working at the cabin up north, it's now not working. Something in the initialization of the hardware I missed after a power cycle and reboots. Now a few steps back I am afraid. (sigh)

Another issue I cannot figure out. I am sure it is probably a setting... My clock signal is a lot brighter than it should be. The scope shows 6vdc but that is impossible because I am only running 3.3v. My DMM confirmed that the signal is NOT that high. Standard crappy probes that came with the Rigol are set at 10x. I have the range set on the clock signal to 3.3v and the clock is off the screen. More to research and learn.

Pi Zero Wifi / STM32F103CBT6 Project Node Servers 2 weeks 3 days ago #18006

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 418
  • Thanks received: 45
MORE TO CONSIDER...

I am considering taking a side road on this project by using a ESP8266. There are two reasons... The I2C is more intimately controllable and there are a ton of examples related to using it as a host. The WIFI of the system also works very well with my wireless LAN and MQTT network hosted on the home server. It also does well with the display OLED I picked for a display. This would remove the STM32F103 from the project as a middle man, and put it in the project area of my system, replacing the ATMEGA 328P Pro Mini. I already have one ready to test and will be testing it's ability to control the SSD1306 128x64 OLED display, buttons, and I2C hosting to my STM32F103. And finally, it will fit nicely in my Old Spice deodorant case of choice. It does well with WS2812B LED's also so that covers the indicator LED's. I have yet to test if all 3 of these features can run on the same device however.

This leaves 4 RPI Zero Wifi's without a purpose though. I could stack them and create an embedded server with shared processing though. Each has 32gb flash cards (class 10) so there is plenty of storage space. This would relieve the home server of embedded operations and be dedicated to that task. Hmm.

Lots to do! Time to get at it. :)

Pi Zero Wifi / STM32F103CBT6 Project Node Servers 2 weeks 3 days ago #18007

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 418
  • Thanks received: 45
What I am researching right now is if the ESP8266 can control SPI and I2C from the same device. It does not have to be simultaneously, but the same module has to be able to connect to the two different protocol buses. I am seeing that it can be done, and it also cannot be done.

Pi Zero Wifi / STM32F103CBT6 Project Node Servers 2 weeks 2 days ago #18008

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 418
  • Thanks received: 45
LOTS to write about!!

OK, as I mentioned earlier, I decided to take a side road and explore using the ESP8266 in place of the RPI Zero WiFi. Yes I lose some local project functionality, but if I create another home server out of the leftover RPI's, or even host it on the home server, then the transition is viable. I have quite a few ESP8266 modules of different flavors and sizes. I have four of the popular ESP-12E development board that uses the CP2102 serial interface built in. I was encouraged by that because I do not want ANYTHING that uses FTDI, but that is another argument in another thread. Since I was playing with the ESP8266 platform, I went back and dusted off my Arduino IDE. Actually, I created a new instance and rebuilt it from the ground up. My favorite version so far is 1.6.9 and seem to have the most success with that version. I was SHOCKED at how much the community contributions have grown!!! There seems to be code for EVERYTHING I want to do now. At least I now have examples to compare my code to. There is even an example for connecting to an NTP server to update the time and date!!

I had two goals, one is now satisfied! I needed to be able to control the SSD1306 128x64 OLED SPI display via SPI from the ESP8266. Connecting it was a snap! All I had to do was remap a couple of connections to free up the I2C SDA and SDL pins on D1 and D2. No issues at all! The example I modified shows the time in digital and analog forms with an attractive SWEEP transition between the formats. DONE! And I am even able to not only include web server features, but MQTT features as well. It works flawlessly!!!

One bug I encountered is that the ESP-12E board I have, and it is persistent across other boards like the WeMos, ESP8266-12, and ESP8266-1 boards. When you reset the system, you lose connectivity and cannot reestablish until you power cycle. It has something to do with DHCP leasing and a DEAUTH command not being sent. A few lines of code added fixed that nicely!! The board I am using seems very stable but I will extensively test that with all possible scenarios I can think of later.

So now it is time to test I2C. After all, I have to be able to get data to and from the project boards via the STM32F103. Yes, I could use serial, but I believe that I2C is more reliable. If I fail at this, serial UART is the backup plan. We will see. :)

Pi Zero Wifi / STM32F103CBT6 Project Node Servers 2 weeks 2 days ago #18009

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 418
  • Thanks received: 45
I have some ESP-8285 boards coming. The 8285 is the exact same thing as the 8266, but it includes 1mb of flash.

http://www.devacron.com/espressif-esp8285-what-we-know-so-far/esp8285_chip/

This thing is so tiny, it can easily be incorporated in any board design, and I am excited about what my Node Server boards are going to look like now that this is available.

Pi Zero Wifi / STM32F103CBT6 Project Node Servers 2 weeks 2 days ago #18010

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

So far, I have been able to get the accurate current time from an NTP server and display it on my OLED. This is huge because each server/client node needs to know what time it is. Why? I mean you can get that from the home server right? But this way, if the home server takes a crap, the nodes can function autonomously. That is the whole idea with this project. I am working on adding a node that has GPS access to get that info in case the home wireless LAN is completely down. In the event the NTP cannot be accessed, then GPS is used to set the time. So long as a valid time packet is moving around the node network, the others will pick it up and sync. NEAT!
Time to create page: 0.238 seconds