Skip to content

angara/ws_esp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32 based weather station

Wind sensor wiring

PR-3000-FSJT-N01

  • green - 485-A
  • blue - 485-B
  • black - Gnd
  • brown - +Vcc (10-30V)

4800 8N1 CRC

120 Ohm line terminal resistor

addr: 1

Modbus notes

Sample:

  • send (addr, func, reg, num, crc): 0x01 0x03 0x00 0x00 0x00 0x01 0x84 0x0A

  • recv (addr, func, len, bytes, crc): 0x01 0x03 0x02 0x00 0x56 0x38 0x7A

  • value: 0x00 0x56 -> 86 -> 8.6 m/s

  • The device modbus address is stored in register 2000 (0x07D0) - [1-247]

  • The device baud rate is configured in register 2001 using an ID:

  • ? Baud rate ID

  • ? 2400 0

  • ? 4800 1

  • ? 9600 2

  • ? 19200 3

RHUMBS = [0, 45, 90, 135, 180, 225, 270, 315]

mbpoll -m rtu -b 4800 -d 8 -P none -s 1 -a 1 -r 1 -c 1 -l 1000 -o 1 /dev/tty.usbserial-1340

ESP32

pip install esptool mpremote

Other tools

Application

Libraries

Copy files from repo to mrequests folder:

Config

Copy config.py to .config.py and set correct variable values.

SUBMIT_USER = ""
SUBMIT_PASS = ""

WIFI_SSID = ""
WIFI_PASS = ""

Autostart at boot (set/remove)

with open("main.py",'w') as f: f.write("import app; app.main()")

import os; os.remove('main.py')

Set Device Address

apt install python3-serial

read_register(addr=1,2000) 01030200017984
1
read_register(addr=1,2001) 01030200017984
1
read_register(addr=1,2002) 0103020000b844
0
read_register(addr=1,2003) 01030266ed53a9
26349
read_register(addr=1,2004) 0103024d5e0cec
19806

About

ESP32 based weather station

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published