GithubHelp home page GithubHelp logo

tiggilyboo / vanny-hub Goto Github PK

View Code? Open in Web Editor NEW
11.0 4.0 2.0 1.11 MB

My van's embedded monitoring platform, using Modbus over RS-485 and RS-232.

CMake 0.61% Shell 0.50% C 98.90%
rs-485 rasberry-pi-pico waveshare-eink embedded monitoring rs-232 renogy

vanny-hub's Introduction

vanny-hub

Hub

What?

My van's embedded monitoring platform, using Modbus over RS-485 and RS-232 on the Raspberry Pi Pico microcontroller.

This is a DIY open source project of my own creation, and as such take no responsibility for this code...

Features

  1. Interface with a range of Renogy Products a) Renogy Rover 40A (RVR40) over Modbus RTU 232 b) Renogy Smart Lithium Battery (LFP100S) over Modbus RTU 485 c) Renogy DC-DC Battery Charger (DCC50S) over Modbus RTU 485
  2. Display information from each of these products on a WaveShare 2.9" E-Ink display
  3. Display statistics over time (Rolling average for the hour, and after 48 hours, 7 days).

Configuration

  • device-lfp10s.h: Register mappings for the LFP100S battery
  • device-dcc50s.h: Register mappings for the DCC50S unit
  • device-rvr40.h: Register mappings for the RVR40 controller

Pinouts

devices-modbus.h contains the various pinouts for the Raspberry Pi Pico UART pins. It makes use of both UARTs (one for modbus 485, and one for 232).

#define UART_RX_TIMEOUT 1000000

#define RS485_PORT      uart0
#define RS485_BR        9600
#define RS485_DBITS     8
#define RS485_SBITS     1
#define RS485_PIN_TX    0
#define RS485_PIN_RX    1
#define RS485_PIN_RTS   22

#define RS232_PORT      uart1
#define RS232_BR        9600
#define RS232_DBITS     8
#define RS232_SBITS     1
#define RS232_PIN_TX    4
#define RS232_PIN_RX    5

vanny-hub.h contains the modbus node configuration, as well as refresh rates and statistic storing rates, as well as the GPIO pin used for changing the screen view.

#define _VERBOSE

#define LED_PIN 25
#define BTN_PIN 21

//#define EPD_UPDATE_PARTIAL
#define EPD_FULL_REFRESH_AFTER    3
#define EPD_REFRESH_RATE_MS       60000

#define RS485_DCC50S_ADDRESS      0x01
#define RS485_LFP100S_ADDRESS     0xf7
#define RS232_RVR40_ADDRESS       0x01

#define STATS_MAX_HISTORY         168
#define STATS_UPDATE_ROLLING_MS   10000     // (secondly)
#define STATS_UPDATE_HISTORIC_MS  3600000  // (hourly)

And finally, the display SPI pinout configuration is defined in display/display-ws-eink.h

#define SPI_PORT      spi1
#define SPI_BD        4000000

#define SPI_PIN_DC    8
#define SPI_PIN_CS    9
#define SPI_PIN_CLK   10
#define SPI_PIN_DIN   11 // Aka. MOSI
#define SPI_PIN_RST   12
#define SPI_PIN_BSY   13

Setup

This project uses the Raspberry Pi Pico, and as such uses it's C API as well as a modbus library (stored as git submodules). This requires the use of:

$ git submodule sync
$ git submodule update

Currently I have only written bash scripts for building and deploying the binaries (Ubuntu / Debian or Arch with minor adjustments of paths). But to use them, simply:

$ ./build.sh
$ ./deploy.sh

vanny-hub's People

Contributors

tbjers avatar tiggilyboo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

sdellysse tbjers

vanny-hub's Issues

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.