Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.68 KB

File metadata and controls

36 lines (27 loc) · 1.68 KB

I'll help you create code for a Raspberry Pi Pico to read data from a Morningstar ProStar charge controller via RS-232 and send it to a Signal K server over WiFi.I've created a complete MicroPython program for your Raspberry Pi Pico W to bridge the Morningstar ProStar charge controller to your Signal K server. Here's what you need to know:

Key Features:

  • Modbus RTU communication with ProStar via RS-232
  • WiFi connectivity to send data to Signal K server
  • Multiple parameters monitored: battery voltage/current, solar panel voltage/current, temperatures, charge state
  • Automatic scaling of raw Modbus values to real units
  • Error handling and CRC validation

Setup Instructions:

  1. Hardware connections:

    • Pico GP0 (TX) → RS-232 board RX
    • Pico GP1 (RX) → RS-232 board TX
    • Connect grounds and power
  2. Configuration (update these in the code):

    • WIFI_SSID and WIFI_PASSWORD
    • SIGNALK_HOST - IP address of your Raspberry Pi 4
    • PROSTAR_ADDRESS - Modbus address of your ProStar (default is 1)
  3. Install MicroPython on Pico W (download from raspberrypi.com)

  4. Upload the code using Thonny IDE or similar

  5. Signal K Server Setup on your Pi 4:

    • Ensure Signal K is accepting PUT requests
    • Data will appear under electrical.batteries.house and electrical.solar paths

Notes:

  • The ProStar uses Modbus RTU protocol at 9600 baud
  • Data is read every 10 seconds (adjustable via READ_INTERVAL)
  • The code includes proper Modbus CRC checking
  • Temperature is converted to Kelvin for Signal K compliance

Would you like me to add any specific features, such as MQTT support, data logging, or different update intervals?