-
1BOM and components sourcing
I'm trying a new experience with online BOM that could facilitate the production and purchase, otherwise the BOM is also available in the zip file, though to facilitate the DIY production, these boards are based on modules.
- STM8S_RF_Dongle_v2 findchip BOM
- Here you need 4x res of 1K in 1206 format
- The STM8S103F3P6 is the small blue pill module (very easy to find online, but not available on raw electronics parts suppliers)
- The nRF24L01+, same is the ready module.
- STM8L_RF_Sensors_v2 findchip BOM
- The BME280 based module is referenced as GY-BMEP
- The MAX44009 module is referenced as GY-49 (both modules are also very easy to find online and not from raw components suppliers)
- MRMS211H, STM8L151F3P6 and resistances are raw components.
- STM8S_RF_Dongle_v2 findchip BOM
-
2STM8 Firmware
- The firmware is located in every corresponding directory close to the Rpi SW in the main IoT_Frameworks repo.
- This repo contains a main libs folder in the root that contains the drivers that are shared by all applications.
- It is possible to use free compilers, but I opted for a fully integrated solution including debug capabilities with the IAR for STM8. It is free for non commercial and requires registration but fully worth it.
- You need an ST-Link_v2 which is available online for very cheap.
- I use the ST Visual Develop to configure the option bits, verification and EEPROM programming (that where the nodeds are)
- You need to install any driver for your USB to serial adapter (e.g. CP2102)
- I use putty as a terminal.
- I use Visual Studio Code for firmware as well
- Note that you can add the include of the IAR compiler to have automatic completion
-
3Portable STM32 Flasher
With the fashion of over the air flashing and all the head ache that comes with (rf boot,...) an alternative solution is a USB power block powered Raspberry pi STM32 flasher, how's that ? Very easy :
- installing the st-tools allow me on windows to run such commands (hang on rpi is down)
st-flash write .\BUILD\BLUEPILL_F103C8\GCC_ARM\rf_uart_interface.bin 0x08000000
- Luckily, some nice dudes provided this tool for the raspberry pi (linux) as well
- The github repo from texane
- The repo is targeted for advanced users, luckily some other nice dudes provide easy instructions
sudo apt-get update sudo apt-get install cmake sudo apt-get install libusb-1.0-0-dev mkdir ~/proj cd ~/proj git clone https://github.com/texane/stlink stlink-repo cd stlink-repo make
- I have the whole pi user folder shared with my windows with samba so I just copy paste the bin on the raspberry pi
- do not forget the sudo for the rights to access the usb
sudo st-flash write rf_uart_interface.bin 0x08000000
Last but not least, how to make this fancy with touch screen raspberry pi, without a third hand for the keyboard.
- Flash script
#!/bin/bash echo "Flash starting...." sudo ./st-flash write smt32_rfpio_firmware.bin 0x08000000 echo "Flash complete press return to exit" read dummy
do not forget to make your script executable
- Desktop shortcut
[Desktop Entry] Name=Flash STM32 Comment=use it to flash the smt32_rfpio_firmware.bin Exec=lxterminal -t "Flash STM32 with rfpio" --working-directory=/home/pi/stlink_tex/stlink-repo/build/Release/ -e ./flash.sh Type=Application Encoding=UTF-8 Terminal=true Categories=None;
- installing the st-tools allow me on windows to run such commands (hang on rpi is down)
-
4Raspberry Pi SW
I know that the Raspberry pi SW installation is not trivial, there's plenty of google entries for every topic, which I required for all steps I've done. I am also not an advanced Linux user and cannot improvise an install or compilation from source that is not described in another wiki somewhere, so here is simply the install list I performed :
- boost (described further in the main github repo)
- POCO : Network components for c++ HTTP servers, websockets and others
- SAMBA : for a convenient access to the RPi and work on windows environment
- MQTT-Mosquitto
- OpenHAB2
-
5PCB Boards
- The design files are available in the github STM8_IoI_Boards, and also attached as zip to this project files.
- These files can be edited and produced with Eagle, the ready to order gerbers cam are also included in the zip file.
- The STM8 Fixed Node v2 is easy as it uses the STM8S breadboard.
- The STM8L Wireless Node (Mobile_v2) is hard as it uses the STM8L151F3 in TSSOP20 format.
- To solder the TSSOP20 manually I use a flat edge iron.
- I bought a lot of very cheap TSSOP20 components and board adapters to practice with.
- The usage of Flux is a must.
- Very important to glue the component first and wait that it holds.
- I ordered the PCBs from an online PCB supplier, which costs about $15 for 10.
- It is important that you combine multiple boards together to drop costs down, so don't hesitate to share the production with friends or community.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
hi Wassim firmware_rf_sensors_node has error CLK_CRTCR_RTCDIV,CLK_CRTCR_RTCSEL and RTC_WUTRH_WUT is undefined , pr04_LightBroadcast,pr02_AmbientLight has lot error i think its not locate lib file
Are you sure? yes | no
Hi @avtop2k , the project firmware_rf_sensors has only pr01_Node_Alive and pr03_PressHumTemp and that were maintained and are still compiling as of the last version, the projects pr02 and pr04 are not maintained because the light broadcast is also available in pr03 in the function rf_light_bcast(). You could reimport the libs correctly but you do not need to do that.
Are you sure? yes | no
Thx Wassim , IoT_SIM8 rgb_leds is receiver only ?, how to make color change to rgb_leds_rf node , is this not latest ? I am not able to understand by the comment "But actually, the STM8 was the very first version of the mesh HW"
Are you sure? yes | no
Yes rgb_leds is receive only, acknowledge excluded. To make the colors change you have to send the corresponding packet frame, the function "rf_rgb_set()" from the file "rf_messages.c" is an example how to send an RGB color packet, that has to be adressed to the corresponding destination node.
The STM8 is a microcontroller that I used in an old project on which I stopped working. Now I am using a different microcontroller, the nRF52 that you can find in my project of the provided link in my previous comment.
Actually, I can help you more if you explain what you would like to do then I might make suggestions, you should stick to the IoT_STM8 only if it is very important to you to use the STM8 and not any other, or you'relearning it for fun.
Are you sure? yes | no
Hi
I am trying to compile IoT_STM8 rgb_leds firmware but in libs giving compile error "rfi_header_size", "rf_pid_0xDF_retransmit", and "rfi_payload_offset" variable not found , I try other code also all giving some error in libs code any suggestion how to compile.
Thx
Are you sure? yes | no
Hi, yes, thank you for your finding, I fixed these compilation errors in the commit I made today just for maintenance
541ae723d424edbea4a077d8590023a95d9712cb
make sure you're using the repo https://github.com/HomeSmartMesh/IoT_STM8
But actually, the STM8 was the very first version of the mesh HW and I stopped working with it, that is why they are deprecated, and at the time, I did not had a good project share with submodules to prevent update of shared libs without breaking other projects.
Since then, I moved to the STM32 for bridges and continuously powered devices, I implemented also a driver for the WS2812B there. https://github.com/HomeSmartMesh/IoT_Frameworks/tree/master/stm32_rf_dongle/rf_bridge
And after the STM32, I switched to the nRF52 for which I found nice small USB dongles that I reflash with nRF firmware. I see you also followed my project #nRF52 Sensors Mesh Network , thank you for your interest, that is the project I am currently actively working on, so if you have questions or require support for that project I will be able to help much easier.
Are you sure? yes | no