Code Monkey home page Code Monkey logo

eslam-abdo / ota Goto Github PK

View Code? Open in Web Editor NEW
21.0 1.0 0.0 4.15 MB

This project is implemented to program BlueBill Board (STM32 Micro-controller) over the air using a website with PHP and NodeMCU board.

Home Page: http://iot-arm.freevar.com/

License: MIT License

HTML 20.78% PHP 1.09% C 72.47% CSS 0.88% Makefile 1.03% Assembly 3.74%
arduino arm at-command embedded embedded-c embedded-systems esp8266 internet-of-things iot microcontroller stm32 stm32cubemx stm32f103 stm32f103c8t6 wifi ota ota-firmware-updates ota-update php

ota's Introduction

OTA (Upload Over The Air) for STM32F103

This project is implemented to program BlueBill Board (STM32 Micro-controller) over the air using a website with PHP and NodeMCU board to get the code from the internet and sending it to STM to write it into the Flash Memory using the Bootloader flashed on the first 9 kB of Flash Memory.

project video (click here)

final-project

Hardware Required

  • STM32F103 BlueBill Board
  • NodeMCU V1.0 Board

Connection

nodemcu / Esp8266 STM32F103
TX PA10
RX PA9
GND GND

The project is divided into three mini-projects

The website is responsible for letting the user upload a .hex file to Server to be ready to be received by NodeMCU. The website only allows .hex to be uploaded.

  • TODO: before compiler the project remember to change the flash size to:
    • FLASH (rx) : ORIGIN = 0x08002400, LENGTH = 55K .

2. NodeMCU

Once a new .hex file is uploaded to Server, and reset STM , NodeMCU reads file content line by line to try sending it STM through UART.

3. STM

On reset, STM Bootloader waits for 5 seconds if there is any code received from NodeMCU. If any, it will first erase the application area and then flash the code received. Once it finished, it will run the application code after 5 seconds. If no code received from NodeMCU for 5 seconds, it will jump to latest flashed application code.

  • NOTE:
    • you need to edit SSID & PASSWORD (and if needed IPserver & Website) in main.h file.
    • I used local PHP Server because the free online server take much time to flash the code.
    • size of Bootloader changed in FPEC_config.h file.

AT-COMMAND for Esp8266/nodemcu

  1. AT >>> TEST AT.
  2. ATE0 >>> STOP ECHO.
  3. AT+RST >>> SOFTWARE RESET.
  4. AT+CWMODE=1 >>> SET STATION MODE.
  5. AT+CWJAP="SSID","PASSWORD" >>> CONNECT TO WIFI (set SSID & PASSWORD).
  6. AT+CIPSTART="TCP","serverIP",80 >>> (replace serverIP with the website ip ) to start connect on server ex: 162.253.155.226).
  7. AT+CIPSEND=numOfBits+1 >>> send data length (replace numOfBits with number of http link bits with GET word ).
  8. GET http://iot-arm.freevar.com/start_flash.php?config=ok >>> put link of website.
  9. Rebeat again from line number 7 of "AT+CIPSTART" because connection will closed after receive data.
  • NOTE: you receive data as form: +IPD,LengthOfData:content....CLOSED.

ota's People

Contributors

eslam-abdo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.