MVM-VC
Links
- https://gitlab.triumf.ca/mvmdev - TRIUMF gitlab repository
- https://gitlab.triumf.ca/mvmdev/gui - TRIUMF copy of mvm_gui (use branch ko_test)
- https://gitlab.triumf.ca/mvmdev/MVMFirmware - TRIUMF copy of mvm firmware (use branch ko_test)
- https://gitlab.triumf.ca/mvmdev/mvmcontroller
- https://gitlab.triumf.ca/mvmdev/mvmcontroller/-/tree/dev-esp32 - ESP32 development branch
- https://gitlab.triumf.ca/mvmdev/hwrev0/-/blob/master/Altium/COVID19%20-%20Ventilator/Project%20Outputs/Schematic%20PDF/COVID19%20-%20Ventilator%20Control%20SCHEMATIC.pdf - board schematics
- https://gitlab.triumf.ca/mvmdev/hwrev0/-/blob/master/Altium/COVID19%20-%20Ventilator/Project%20Outputs/Board%20PDF/COVID19%20-%20Ventilator%20Control%20BOARD.PDF - board layout
- Italian repositories:
- https://github.com/NuclearInstruments/MVMFirmware - Milano git repository
- https://github.com/MVMSoftware/gui - GUI git repository
- https://edev-group.triumf.ca/hw/ventilator-controller/rev0 - TRIUMF edev repository
- https://edev-group.triumf.ca/hw/ventilator-controller/rev0/-/blob/master/Altium/COVID19%20-%20Ventilator/Project%20Outputs/Schematic%20PDF/COVID19%20-%20Ventilator%20Control%20SCHEMATIC.pdf - board schematics
- https://edev-group.triumf.ca/hw/ventilator-controller/rev0/-/blob/master/Altium/COVID19%20-%20Ventilator/Project%20Outputs/Board%20PDF/COVID19%20-%20Ventilator%20Control%20BOARD.PDF - board layout
- ESP32 - ESP32 information: adafruit HUZZA32 and ESP-WROOM32 modules
- RPI3 - RaspberryPi3 information: install Raspbian, etc
General information
- external power supply: 24 VDC screw terminals
- regulated down to 5V USB power (+5V_USB) which is
- regulated down to 3.3V (+3V_CPU)
- 4 channels of relay drivers
- 2 screw terminals (CPU_BUZZ/BUZZ and CPU_AUX/AUX1)
- 2 screw terminals (CPU_LED1/AUX2 and CPU_LED2/AUX3)
- connection for "featherwing 2.4in" display
- 7 screw terminals for I2C (I2C 0..6)
- 1 screw terminal for SPI (EXT_SPI_CS0)
- 1 pressure sensor
- 3 sites for microcontroller (only 1 at a time): Adafruit HUZZA32, NanoPi, RaspberryPi
Switches and Jumpers
- JMP3/JMP4 - select +3V_CPU from our regulator or from ESP32 internal regulator
- SW1/SW2/SW3/SW4 - select I2C power +3V_CPU or +5V_USB
- JMP1_DRV1/JMP2_DRV1 (DRV1..DRV4) - select relay driver
Connectors
- power: 24VDC two pin screw terminal
- adafruit huzzah32 socket
- nanopi socket
- raspberry pi 3B socket (40 pin J8)
- SPI: six pin screw teminal
- I2C0..I2C6: four pin screw terminals. i2c switch port order is: SPI, I2C0, I2C1, ... I2C6
- 4x two pin screw terminals: CPU_BUZZ, AUX1, AUX2, AUX3.
Test plan
Done:
- ESP32 I2C communication with pressure sensor (standalone): [BS 2020apr2].
- board powered 24V: [DB/BS 2020apr4]
- ESP32 runs: [BS 2020apr4, KO 2020apr5]
- RaspberryPi runs: [LM 2020apr5, KO 2020apr5]
- ESP32 to RPi3 USB connection ok, ESP32 powered from USB or 24VDC ok, no crash when 24VDC power is cycled [KO 2020apr5]
- ESP32 featherwing TFT display ok (standalone): [KO 2020apr5]
- control and readback of relays (valves): ESP32 [BS 2020apr4], RPi [LM 2020apr5, KO 2020apr5]
- I2C communication: ESP32 [BS 2020apr4], RPi [LM 2020apr5]
- ESP32 Wifi radio works: [KO 2020apr5]
- ESP32 Wifi communication: [BS 2020apr7]
Problems found:
- SPI communication: ESP32 [BS 2020apr4], RPi [KO 2020apr9]
Partial:
- Pressure sensor readout (I2C): ESP32 [BS 2020apr4], RPi [...]
- flow meter readout (I2C): ESP32 [BS 2020apr7], RPi [...]
- external I2C: ESP32 [BS 2020apr7], RPi [...]
- BUZZ, AUX1: ESP32 [...], RPi [KO 2020apr4]
- CPU DRV RSTn works: ESP32 [...], RPi [KO 2020apr9]
Pending:
- AUX2, AUX3: ESP32 [...], RPi [...]
- featherwing display: ESP32 [...], RPi [...]
- proportional valve control (DAC): ESP32 [...]
- proportional valve control (PWM): ESP32 [...], RPi [...]
- RPi Wifi client: [...]
- RPi Wifi hotspot: [...]
- RPi touch screen: [...]
System configurations permitted by hardware
- "Italian model": [ MVM-VC + ESP32 ] ---- usb-serial ---- [ RPi3 + GUI ] (remote control) ---- wifi or cat5 or SD/USB flash for data collection
- "one ESP32": [ MVM-VC + ESP32 + small LCD + mini-GUI ] ---- wifi for data collection (no cat5, no SDflash)
- "one Pi": [ MVM-VC + RPi + GUI ] ---- wifi or cat5 or SD/USB flash for data collection
- "two Pi": [ MVM-VC + RPi/NanoPi ] ---- cat5 ---- [ RPi + GUI ] ---- wifi or SD/USB flash for data collection
- "three Pi": [ MVM-VC + RPi/NanoPi (control) ---???--- RPi + GUI (local control) ] ---???--- [ RPi + GUI ] (remote control)
- "2.5 Pi": [ MVM-VC + ESP32 --- usb-serial --- RPi + GUI (local control) ] ---- cat5 ---- [ RPi + GUI ] (remote control)
Notable hardware limitations:
- MVM-VC can be fully operated by ESP32 or RPi or NanoPi (not at the same time)
- ESP32: yes wifi, no cat5 ethernet, no usb, no sd flash (sd flash maybe via adafruit LCD "feather")
- NanoPi: maybe wifi, maybe HDMI/DP connector to drive monitor (NanoPi to be confirmed)
- RPi is the most capable: cat5/rj45 ethernet, wifi, HDMI/DP, USB, SD flash slot.
Abbreviations: MVM-VC - TRIUMF PCB, ESP32 - adafruit HUZZA32/WROOM32/ESP32 icrocontroller, RPi - RaspberryPi, NanoPi - NanoPi, GUI - medium size LCD running the MVM python GUI, mini-GUI - small size LCD running minimal GUI coded in ESP32.
RPi3/4 connections
!!! ALL GPIO PINS are 3.3V, NOT 5V safe !!!
RPI3 - link to the RPi3 page
Note1: GPIO pin numbers on MVM-VC board schematics are the "WiringPi" pin numbers. They do not correspond to GPIO pin numbers on the RPi3/RPi4 schematics.
Note2: special purpose pins for SPI and I2C are correct.
RPi3/4 names are per J8 schematics:
- RPi4 : https://www.raspberrypi.org/documentation/hardware/raspberrypi/schematics/rpi_SCH_4b_4p0_reduced.pdf
- RPi3B+ : https://www.raspberrypi.org/documentation/hardware/raspberrypi/schematics/rpi_SCH_3bplus_1p0_reduced.pdf
- RPi3B : https://www.raspberrypi.org/documentation/hardware/raspberrypi/schematics/rpi_SCH_3b_1p2_reduced.pdf
RPi3/4 name - WiringPi name - J8 header pin - baseboard name - function GPIO8 - GPIO10/CE0 - 24 - CPU SPI CS (SPI) - (output) SPI nCS GPIO9 - GPIO13/MISO - 21 - CPU MISO (SPI) - (input) SPI MISO GPIO10 - GPIO12/MOSI - 19 - CPU MOSI (SPI) - (output) SPI MOSI GPIO11 - GPIO14/SCLK - 23 - CPU SCK (SPI) - (output) SPI CLK GPIO22 - GPIO3 - 15 - CPU DRV STAT4 - (open drain 3.3V input) GPIO5 - GPIO21 - 29 - CPU DRV STAT3 - (same) GPIO6 - GPIO22 - 31 - CPU DRV STAT2 - (same) GPIO13 - GPIO32 - 33 - CPU DRV STAT1 - (same) GPIO26 - GPIO25 - 37 - CPU BUZZ - (maybe output) direct connection to BUZZ screw terminal GPIO19 - GPIO24 - 35 - CPU AUX - (maybe output) direct connection to AUX screw terminal GPIO27 - GPIO2 - 13 - CPU_LED1 - (output) drives open-drain 3.3V AUX2 GPIO17 - GPIO0 - 11 - CPU_LED2 - (output) same, AUX3 GPIO21 - GPIO29 - 40 - CPU DRV CH1 - (output) drives buffer GPIO20 - GPIO28 - 38 - CPU DRV CH2 - (same) GPIO16 - GPIO27 - 36 - CPU DRV CH3 - (same) GPIO12 - GPIO26 - 32 - CPU DRV CH4 - (same) GPIO4 - GPIO7 - 7 - CPU DRV RSTn - (output, pull up to 3.3V) drives nRESET of I2C and SPI chips GPIO3 - GPIO9/SCL1 - 5 - CPU SCL - (I2C, pull up to 3.3V) GPIO2 - GPIO8/SDA1 - 3 - CPU SDA - (I2C, pull up to 3.3V) 3.3VDC - 1 - "+3V_CPU2", N/C if JMP4 open 3.3VDC - 17 - "+3V_CPU2", see above 5.0VDC - 2 - +5V_USB 5.0VDC - 4 - +5V_USB GND - 6 - GND GND - 9 - GND GND - 14 - GND GND - 20 - GND GND - 25 - GND GND - 30 - GND GND - 34 - GND GND - 39 - GND GPIO14 - GPIO15/TX - 8 - Pi3 CPU TX - N/C GPIO15 - GPIO16/RX - 10 - Pi3 CPU RX - N/C GPIO18 - GPIO1 - 12 - N/C GPIO32 - GPIO4 - 16 - N/C GPIO24 - GPIO5 - 18 - N/C GPIO25 - GPIO6 - 22 - N/C GPIO7 - GPIO11/CE1 - 26 - N/C ID_SD - SDA0 - 27 - N/C ID_SC - SCL0 - 28 - N/C RPi PWM pins: GPIO12, GPIO13, GPIO18, GPIO19
NanoPi connections
TBW
ESP32 connections
!!! ALL GPIO PINS are 3.3V, NOT 5V safe !!!
ESP32 - link to the ESP32 page
- ESP32 power: per https://learn.adafruit.com/adafruit-huzzah32-esp32-feather/power-management, last "not recommended" option: "Connect an external 5V power supply to the USB and GND pins"
- Pinouts Rev 2020apr5
ESP32 pin and name - WROOM32 - HUZZA32 - header - baseboard - function "bottom row" 42 - GPIO21 - IO21 - 21 - JP1-1 - A1 - CPU SPI CS (SPI) - (output) SPI nCS - mux GPIO21 or VSPIHD 41 - U0TXD - TXD0 - TX/17 - JP1-2 - A2 - FTHR CPU TX - N/C - mux GPIO1 or U0TXD 40 - U0RXD - RXD0 - RX/16 - JP1-3 - A3 - FTHR CPU RX - N/C - mux GPIO3 or U0RXD 38 - GPIO19 - IO19 - MISO/19 - JP1-4 - A4 - CPU MISO (SPI) - (input) SPI MISO - mux GPIO19 or U0CTS or VSPIQ 35 - GPIO18 - IO18 - MOSI/18 - JP1-5 - A5 - CPU MOSI (SPI) - (output) SPI MOSI - mux GPIO18 or VSPICLK 34 - GPIO5 - IO5 - SCK/5 - JP1-6 - A6 - CPU SCK (SPI) - (output) SPI CLK - mux GPIO5 or VSPICS0 24 - GPIO4 - IO4/A2_0 - ADC2/A5/4 - JP1-7 - A7 - CPU DRV STAT4 - (open drain 3.3V input) - mux GPIO4 or RTC_GPIO10 5 - SENSOR_VP C16/270pF - IO36/SEN_VP/A1_0 - ADC1/A4/36 - JP1-8 - A8 - CPU DRV STAT3 - (same) - mux GPIO36 or RTC_GPIO0 (input only) 8 - SENSOR_VN C17/270pF - IO39/SEN_VN/A1_3 - ADC1/A3/39 - JP1-9 - A9 - CPU DRV STAT2 - (same) - mux GPIO39 or RTC_GPIO3 (input only) 10 - VDET_1 - I34/A1_6 - "input only" ADC1/A2/34 - JP1-10 - A10 - CPU DRV STAT1 - (same) - mux GPIO34 or RTC_GPIO4 (input only) 14 - GPIO25 - IO25/DAC1/A2_8 - ADC2/A1/DAC1/25 - JP1-11 - A11 - N/C - reserved for DAC output - mux GPIO25 or RTC_GPIO6 or DAC1 15 - GPIO26 - IO26/DAC2/A2_9 - ADC2/A0/DAC2/26 - JP1-12 - A12 - CPU BUZZ - (maybe output) direct connection to BUZZ screw terminal - mux GPIO26 or RTC_GPIO7 or DAC2 none - none - GND - JP1-13 - A13 - GND none - none - NC - JP1-14 - A14 - N/C none - none - "3V" - JP1-15 - A15 - "+3V_CPU2" none - none - RST - JP1-16 - A16 - CPU RESET - N/C "top row" none - none - BAT - JP3-1 - B1 - N/C none - none - EN - JP3-2 - B2 - N/C none - none - USB - JP3-3 - B3 - "+5V_USB" 20 - MTCK - IO13/A2_4 - "red LED" ADC2/13/A12 - JP3-4 - B4 - CPU_LED1 - (output) drives open-drain 3.3V AUX2 - mux GPIO13 or RTC_GPIO14 18 - MTDI - IO12/A2_5 - "internal pulldown, output only" ADC2/12/A11 - JP3-5 - B5 - CPU_LED2 - (output) same, AUX3 - mux GPIO12 or RTC_GPIO15 - "boot fail if pulled high" 16 - GPIO27 - IO27/A2_7 - ADC2/27/A10 - JP3-6 - B6 - CPU DRV CH1 - (output) drives buffer - mux GPIO27 or RTC_GPIO17 13 - 32K_XN - IO33/A1_5/X32N - ADC1/33/A9 - JP3-7 - B7 - CPU DRV CH2 - (same) - mux GPIO33 or RTC_GPIO8 21 - MTDO - IO15/A2_3 - ADC2/15/A8 - JP3-8 - B8 - CPU DRV CH3 - (same) - mux GPIO15 or RTC_GPIO13 12 - 32K_XP - IO32/A1_4/X32P - ADC1/32/A7 - JP3-9 - B9 - CPU DRV CH4 - (same) - mux GPIO32 or RTC_GPIO9 17 - MTMS - IO14/A2_6 - ADC2/14/A6 - JP3-10 - B10 - CPU DRV RSTn - (output, pull up to 3.3V) drives nRESET of I2C and SPI chips, mux GPIO14 or RTC_GPIO16 39 - GPIO22 - IO22 - SCL/22 - JP3-11 - B11 - CPU SCL - (I2C, pull up to 3.3V) - mux GPIO22 or U0RTS 36 - GPIO23 - IO23 - SDA/23 - JP3-12 - B12 - CPU SDA - (I2C, pull up to 3.3V) - mux GPIO23 not on header, internally connected on HUZZA32: 11 - VDET_2 - I35/A1_7 - ADC1/35/A13 - N/C - VBAT voltmeter (through divider) - mux GPIO35 or ADC1_CH7 or RTC_GPIO5 (input only) not clear what function: 23 - GPIO0 - IO0/A2_1 - GPIO0 - serial RTS - mux GPIO0 or RTC_GPIO11 22 - GPIO2 - IO2/A2_2 - GPIO2 - serial DTR (looks like mistake on schematic) - mux GPIO2 or RTC_GPIO12 25 - GPIO16 - IO16 - IO16 - not connected? - mux GPIO16 or U2RXD 27 - GPIO17 - IO17 - IO17 - not connected? - mux GPIO17 or U2TXD 9 - CHIP_PU - EN - RESET - push button - no mux WROOM32 flash memory connection ("U3"): 28 - SD_DATA_2 - SD2 - n/c - mux SD_DATA2 or GPIO9 29 - SD_DATA_3 - SD3 - n/c - mux SD_DATA3 or GPIO10 30 - SD_CMD - CMD - n/c - mux SD_CMD or GPIO11 31 - SD_CLK - CLK - n/c - mux SD_CLK or GPIO6 32 - SD_DATA_0 - SD0 - n/c - mux SD_DATA0 or GPIO7 33 - SD_DATA_1 - SD1 - n/c - mux SD_DATA1 or GPIO8 Not connected to ESP32: CPU AUX - (maybe output) direct connection to AUX screw terminal Note: - I2C controller can use any/all GPIO pins - SPI controller can use any/all GPIO pins
I2C addresses
- 0x70 - I2C switch - U1 - TI TCA9548APWR [Datasheet]
- 0x76 - pressure sensor - i2c switch port 7 mask 0x80 - "TE Connectivity Measurement Specialties" 5525DSO-DB001DS [Datasheet]
- 0x80 - flow meter - i2c switch port 0 mask 0x01 - SFM3000 - https://gitlab.triumf.ca/mvmdev/mvmcontroller/-/blob/dev-esp32/docs/datasheets/Sensirion-Mass-Flow-Meters-SFM3000-I2C-Functional-Description.pdf https://gitlab.triumf.ca/mvmdev/mvmcontroller/-/blob/dev-esp32/docs/datasheets/Sensirion_Mass_Flow_Meters_SFM3000_Datasheet.pdf https://gitlab.triumf.ca/mvmdev/mvmcontroller/-/blob/dev-esp32/docs/datasheets/SFM3xxx_Extended_I2C_Command_Set.pdf
To probe the pressure sensor:
$ i2cset -y 1 0x70 0 0x80 $ i2cget -y 1 0x70 0x80 $ i2cdetect -y 1 ### detects: 0x70 (switch) and 0x76 (pressure sensor) 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: 70 -- -- -- -- -- 76 --
Pressure sensor
Calibration constants (chip on KO's board)
pi@raspberrypi:~ $ i2cget -y 1 0x76 0xa0 w 0x0100 pi@raspberrypi:~ $ i2cget -y 1 0x76 0xa1 w 0x0100 pi@raspberrypi:~ $ i2cget -y 1 0x76 0xa2 w 0x2b39 pi@raspberrypi:~ $ i2cget -y 1 0x76 0xa3 w 0x2b39 pi@raspberrypi:~ $ i2cget -y 1 0x76 0xa4 w 0x521e pi@raspberrypi:~ $ i2cget -y 1 0x76 0xa5 w 0x521e pi@raspberrypi:~ $ i2cget -y 1 0x76 0xa6 w 0x250e pi@raspberrypi:~ $ i2cget -y 1 0x76 0xa7 w 0x250e pi@raspberrypi:~ $ i2cget -y 1 0x76 0xa8 w 0x1a07 pi@raspberrypi:~ $ i2cget -y 1 0x76 0xa9 w 0x1a07 pi@raspberrypi:~ $ i2cget -y 1 0x76 0xaa w 0x3d94 pi@raspberrypi:~ $ i2cget -y 1 0x76 0xab w 0x3d94 pi@raspberrypi:~ $ i2cget -y 1 0x76 0xac w 0x6b1f pi@raspberrypi:~ $ i2cget -y 1 0x76 0xad w 0x6b1f pi@raspberrypi:~ $ i2cget -y 1 0x76 0xae w 0x0c00 pi@raspberrypi:~ $ i2cget -y 1 0x76 0xae w 0x0c00 pi@raspberrypi:~ $ i2cget -y 1 0x76 0xaf w 0x0c00
- read ADC, no conversion
root@raspberrypi:~/i2c-tools-4.1/tools# ./i2cget3 -y 1 0x76 0 write returned 1 read returned 4, value 0x3f000000
Flow sensor
TBW
SPI
SPI devices:
- CSn CPU_SPI_CS - MCP23S08-E/SS - 10 MHz - https://gitlab.triumf.ca/mvmdev/hwrev0/-/blob/master/Altium/Datasheets/MCP23008-MCP23S08-Data-Sheet-20001919F.pdf
Proportional Valve Italian firmware
- From Bryerton:
The Italian's use the PWM on DAC1 / A0 / IO25 pin. The API is the ledc API used to control an LED via PWM
- see ArduinoCorePP_PWM_hw_v3.ino
- function setup() attach pin "DAC1" to ledc
ledcSetup(0, 10000, 12); // KO: chan 0, freq in kHz, how many bits of PWM 12 bits = range 0..4095 ledcAttachPin(DAC1, 0); // KO: IO25/A0/DAC1 ledcWrite(0, 0);
- function PressureControlLoop_PRESSIN() see ledcWrite()
if (Pset == 0) { ledcWrite(0, 0); } else { pid_outb = ...; // KO: looks like a digital PID controller if (pid_outb<0) pid_outb=0; // KO: low limit pid_outb = pid_outb + 500; // KO: what is this?!? if (pid_outb>4090) pid_outb=4090; // KO: high limit ledcWrite(0, pid_outb); // KO: value 500..4090 }
- also see valve_control() commented absent code for PWM.
MVM-GUI
Install
- as root:
- apt-get update
- apt-get install python3-pyqt5 python3-numpy python3-pyqtgraph python3-serial
- ### does not work, installs wrong pip: apt-get install python3-pip
- curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
- python3 get-pip.py --force-reinstall
- ### does not work, installs too-old version of yaml 3.13: apt-get install python3-yaml
- pip3 install PyYAML ### version 5.3.1
- ssh pi@rpi
- ### use TRIUMF gitlab branch ko_test instead ### git clone git clone https://github.com/MechanicalVentilatorMilano/gui.git
- git clone https://gitlab.triumf.ca/mvmdev/gui.git
- git checkout ko_test
Run with python simulator
- cd gui
- ./mvm_gui.py fakeESP32
Run with ESP32 simulator
- load the ardiuno sketch mock/mock.ino into ESP32 (see instructions below)
- ./mvm_gui.py ### default connection is /dev/ttyUSB0 at 115200 bps, change it in default_settings.yaml
MVM-Firmware
- ssh pi@...
- ### use TRIUMF gitlab branch ko_test instead ### git clone https://github.com/NuclearInstruments/MVMFirmware.git
- git clone https://gitlab.triumf.ca/mvmdev/MVMFirmware.git
- git checkout ko_test
- cd arduino; ./ardiuno
- open .../MVMFirmware/ArduinoCorePP_PWM_hw_v3/ArduinoCorePP_PWM_hw_v3.ino
- install library SimpleCLI (1.0.9), aREST (2.8.0)
- build sketch (there is warnings about TwoWire::requestFrom())
- load sketch
- serial 115200
- output
ets Jun 8 2016 00:22:57 rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:1 load:0x3fff0018,len:4 load:0x3fff001c,len:1044 load:0x40078000,len:8896 load:0x40080400,len:5816 entry 0x400806ac SCAN I2C BUS: 0 Scanning... I2C No I2C devices found SCAN I2C BUS: 1 Scanning... I2C No I2C devices found SCAN I2C BUS: 2 Scanning... I2C No I2C devices found SCAN I2C BUS: 3 Scanning... I2C No I2C devices found SCAN I2C BUS: 4 Scanning... I2C No I2C devices found SCAN I2C BUS: 5 Scanning... I2C No I2C devices found SCAN I2C BUS: 6 Scanning... I2C No I2C devices found SCAN I2C BUS: 7 Scanning... I2C No I2C devices found SENSOR: 0 SENS_T1: 65535 OFF_T1: 65535 TCS: 65535 TCO: 65535 TREF: 65535 TEMPSENS: 65535 OFFSET: 0.00 SENSOR: 1 SENS_T1: 65535 OFF_T1: 65535 TCS: 65535 TCO: 65535 TREF: 65535 TEMPSENS: 65535 OFFSET: 0.00 SENSOR: 2 SENS_T1: 65535 OFF_T1: 65535 TCS: 65535 TCO: 65535 TREF: 65535 TEMPSENS: 65535 OFFSET: 0.00 SENSOR: 3 SENS_T1: 65535 OFF_T1: 65535 TCS: 65535 TCO: 65535 TREF: 65535 TEMPSENS: 65535 OFFSET: 0.00 SFM driver version 0.1.0 SFM sensor probing failed ... Measure Flow Sensor initialized!
- send: "get all", reply: "valore=0.00,0.00,0,0,0,0,0,0,1"
Dev-esp32 Firmware
- install esp-idf per https://daq.triumf.ca/DaqWiki/index.php/ESP32#idf.py
- . ~/esp/esp-idf/export.sh
- idf.py --version ### my version is "ESP-IDF v4.2-dev-1054-g7d0f1536e-dirty"
- git clone git@gitlab.triumf.ca:mvmdev/mvmcontroller.git
- cd mvmcontroller
- ### git checkout dev-esp32
- git checkout ko_test
- cd src
- espsecure.py generate_signing_key --version 1 secure_boot_signing_key.pem
- idf.py build
- ...
- idf.py -p /dev/ttyUSB0 flash monitor
ets Jun 8 2016 00:22:57 rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:4 load:0x3fff0034,len:7068 load:0x40078000,len:13696 load:0x40080400,len:3984 0x40080400: _init at ??:? entry 0x40080688 I (29) boot: ESP-IDF v4.2-dev-1054-g7d0f1536e 2nd stage bootloader I (29) boot: compile time 01:36:43 I (29) boot: chip revision: 1 I (33) boot_comm: chip revision: 1, min. bootloader chip revision: 0 I (40) boot.esp32: SPI Speed : 40MHz I (45) boot.esp32: SPI Mode : DIO I (49) boot.esp32: SPI Flash Size : 4MB I (54) boot: Enabling RNG early entropy source... I (59) boot: Partition Table: I (63) boot: ## Label Usage Type ST Offset Length I (70) boot: 0 nvs WiFi data 01 02 00019000 00004000 I (78) boot: 1 otadata OTA data 01 00 0001d000 00002000 I (85) boot: 2 phy_init RF data 01 01 0001f000 00001000 I (93) boot: 3 ota_0 OTA app 00 10 00020000 001e0000 I (100) boot: 4 ota_1 OTA app 00 11 00200000 001e0000 I (108) boot: End of partition table I (112) boot_comm: chip revision: 1, min. application chip revision: 0 I (119) esp_image: segment 0: paddr=0x00020020 vaddr=0x3f400020 size=0x21aac (137900) map I (181) esp_image: segment 1: paddr=0x00041ad4 vaddr=0x3ffb0000 size=0x03c8c ( 15500) load I (187) esp_image: segment 2: paddr=0x00045768 vaddr=0x40080000 size=0x00404 ( 1028) load 0x40080000: _WindowOverflow4 at /home/pi/esp/esp-idf/components/freertos/xtensa/xtensa_vectors.S:1730 I (188) esp_image: segment 3: paddr=0x00045b74 vaddr=0x40080404 size=0x0a4a4 ( 42148) load I (215) esp_image: segment 4: paddr=0x00050020 vaddr=0x400d0020 size=0x9d848 (645192) map 0x400d0020: _stext at ??:? I (460) esp_image: segment 5: paddr=0x000ed870 vaddr=0x4008a8a8 size=0x0ce2c ( 52780) load 0x4008a8a8: rcUpdateTxDoneAmpdu2 at ??:? I (484) esp_image: segment 6: paddr=0x000fa6a4 vaddr=0x00000000 size=0x058dc ( 22748) I (505) boot: Loaded app from partition at offset 0x20000 I (505) boot: Disabling RNG early entropy source... I (506) cpu_start: Pro cpu up. I (509) cpu_start: Application information: I (514) cpu_start: Project name: mvm_controller I (520) cpu_start: App version: ace886e I (525) cpu_start: Compile time: Apr 11 2020 02:02:04 I (531) cpu_start: ELF file SHA256: 92aa223022139bbe... I (537) cpu_start: ESP-IDF: v4.2-dev-1054-g7d0f1536e I (543) cpu_start: Starting app cpu, entry point is 0x40081658 0x40081658: call_start_cpu1 at /home/pi/esp/esp-idf/components/esp32/cpu_start.c:277 I (0) cpu_start: App cpu up. I (554) heap_init: Initializing. RAM available for dynamic allocation: I (560) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM I (567) heap_init: At 3FFB9A88 len 00026578 (153 KiB): DRAM I (573) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM I (579) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (586) heap_init: At 400976D4 len 0000892C (34 KiB): IRAM I (592) cpu_start: Pro cpu start user code I (610) spi_flash: detected chip: generic I (611) spi_flash: flash io: dio I (611) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. I (620) main: Running partition type 0 subtype 16 (offset 0x00020000) I (650) CTRL: Starting controller task I (650) CTRL: Initializing HAL down: 0| Intr:0 I (660) gpio: GPIO[34]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (680) gpio: GPIO[36]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (660) system_api: Base MAC address is not set I (680) gpio: GPIO[39]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (690) system_api: read default base MAC address from EFUSE I (700) gpio: GPIO[12]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (710) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (720) wifi:I (720) gpio: GPIO[14]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 wifi driver task: 3ffbb8a0, prio:23, stack:3584, core=0I (740) gpio: GPIO[15]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (750) gpio: GPIO[27]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (760) gpio: GPIO[32]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (760) gpio: GPIO[33]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (760) wifi:I (770) HAL: Initializing I2C wifi firmware version: 2bd4864 I (780) wifi:wifi certification version: v7.0 I (780) HAL: Resetting I2C Mux I (790) wifi:I (790) HAL: Selecting PS1 I2C Bus config NVS flash: enabled I (800) wifi:config nano formating: disabled W (800) HAL: Mux Error -1 I (800) wifi:I (800) HAL: Initializing PS1 Init dynamic tx buffer num: 32 I (810) wifi:Init data frame dynamic rx buffer num: 32 I (810) wifi:Init management frame dynamic rx buffer num: 32 W (820) HAL: Reset Error -1 I (820) wifi:Init management short buffer num: 32 W (820) HAL: Coeff Error -1 I (830) wifi:I (830) HAL: PS1 Coeff1 0x0 Init static rx buffer size: 1600I (830) HAL: PS1 Coeff2 0x0 I (850) HAL: PS1 Coeff3 0x0 I (850) HAL: PS1 Coeff4 0x0 I (850) wifi:I (850) HAL: PS1 Coeff5 0x0 Init static rx buffer num: 10I (860) HAL: PS1 Coeff6 0x0 I (860) HAL: Selecting FS1 I2C Bus I (860) wifi:Init dynamic rx buffer num: 32 W (870) HAL: Mux Error -1 I (950) phy: phy_version: 4180, cb3948e, Sep 12 2019, 16:39:13, 0, 0 I (950) wifi:mode : sta (a4:cf:12:7d:0a:24) I (5380) HAL: Flow Offset: 0.000000 I (5380) HAL: Flow Scale Factor: 0.000000 I (5380) HAL: Flow Product: 0x0 I (5390) HAL: Flow Serial: 0x0 I (5390) CTRL: Initializing Controller W (5390) HAL: Mux Error -1
- type "get all"
valore=51,12,12,13,1200,8,42,0,57
- connect to it from the gui, it works.