Code Monkey home page Code Monkey logo

stm32f7_lxi_device's Introduction

STM32F7_LXI_Device

STM32 based LXI Device using Ethernet, LwIP, httpd, SCPI

Build Status


  • stm32f746zg (Nucleo)
  • STM32CubeIDE

Working

  • ✅ DHCP IP Address Management
    • MCU continues to run even without active Ethernet connection
    • MCU connects to Network when pluged in via Ethernet
  • ✅ http web interface
    • ✅ has switches to turn on/off configurations
    • ✅ uses CGI/SSI
    • ⚠️ mandatory /lxi/identification.xml is present (but not detected by the LXI tool)
  • ✅ custom physical MAC address from within firmware
    • ✅ unique EUI48 address is read from EEPROM
  • ✅ EEPROM to save/load user settings (IP, DHCP config ...)
  • ✅ Settings allow to enable/disable DHCP + AutoIP or manual settings (IP/Netmask/Gateway)

Sources

Tools

  • official LXI Discovery Tool
    • This sends out a UDP/RPC/Portmap broadcast with the GETPORT command
    • the LXI device must reply to this broadcast in rcp_server.c
    • Then the tool requests the http://<host>/lxi/identification.xml from the device
  • lxi-tools
    • This sends out a UDP/RPC/Portmap broadcast with the GETPORT command
    • according to wireshark, the device does not reply --> how does it work then?
    • The tool will attempt to connect to the device via VXI-11 and *IRQ? the name
  • Wireshark

Todo

🔄 ⚠️
Todo WIP Debug (broken) Done (working)

Todo Critical

Todo Whishlist

  • ❌ [Feature] function to check web connection status
    • or callback handlers when connected / disconnected
  • ❌ [reliability] Add further ASSERT() statements throughout the code (e.g. for SSI)
  • ❌ [refactor] author/licence/description header for each file
  • 🔄 [refactor] cleanup spaghetti code of global variables, introduce hierarchy of config headers
  • ❌ [refactor] implement clear MVC structure for SCPI commands
  • ❌ [Feature] add hislip compatibility
  • ❌ [refactor] refactor/rename scpi_server.c to tcp/ip (does this have a name? VXI?)
  • ❌ [reliability] use MUTEX for UART ringbuffer?
  • ❌ [reliability] implement a memory monitor (FreeRTOS?) to check on heap/stack/RAM usage
  • ❌ [refactor] use SCPI_Result**** API as return throughout scpi User Code
  • ❌ [Feature] enable https within lwip
  • ❌ [Feature] enable web login
    • probably not supported by LwIP, requires form post and session creation using a cookie in the post header
    • password is stored on EEPROM
    • redesign of web interface is required

Documentation

  • exclude from build:
    • fs_data.c
    • fs_data_custom.c

Helper Libraries

  • lwip/ip4_addr.h parse and verify IPv4 addresses (documentation)

  • scpi/parser.h parse and extract parameters from ascii (documentation)

Features

File Structure

Core/Src and Core/Inc

  • scpi-def.c
    • SCPI commands definition
    • SCPI command callback functions
    • command parsing, argument preprocessing + sanitization
  • stm32f7xx_it.c
    • USART Interrupt for UART SCPI
  • http_cgi_app.c
    • CGI + SSI implementation for the httpd Webserver
    • SSI works for both the Website and the identification.xml
  • rpc_server.c
    • implements the Sun-RPC Protocol based on UDP (more specifically the Portmap protocol)
    • When a UDP Broadcast (IP address: xxx.xxx.xxx.255) is received, the LXI device must answer correctly

Tools/fs

  • Filesystem for the Webserver
  • use any program makefsdata (perl, C, ...) to convert the file System to a C source file fs_data_custom.c
  • fs_data_custom.c must be copied to ./Middlewares/Third_Party/LwIP/src/apps/http after re-generation

LWIP/App

  • lwip.c
    • initialization with DHCP
    • initialization with manual IP

LWIP/Target

  • LWIP/Target/ethernetif.c contains some User Code to set the PHY/MAC address

  • eeprom_24aa.h contains macros to store and retreive data (e.g. manual IP config) in EEPROM

Webserver

SSI CGI

#define LWIP_HTTPD_MAX_TAG_NAME_LEN 8 #define LWIP_HTTPD_MAX_TAG_INSERT_LEN 192

stm32f7_lxi_device's People

Contributors

mnemocron 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  avatar  avatar  avatar  avatar

stm32f7_lxi_device's Issues

Status of the Project - "production" usable?

Hey,

Thanks for the awesome work! Looks very nice and well documented! 💯

Apart from the listed bugs/issues in the Readme, is there anything I should know before diving into this and trying to use it in a "productive/production" setup?

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.