Diferència entre revisions de la pàgina «Siarq's Hybrid 2.2»
(Es crea la pàgina amb «This wiki is written to understand current LoRaWAN protocol being sent by Siarq's Hybrid 2.2 (LoRaWAN version). = LoRaWAN version = [https://eu1.cloud.thethings.netwo...».) |
m (→MQTT(S)) |
||
(Hi ha 28 revisions intermèdies del mateix usuari que no es mostren) | |||
Línia 3: | Línia 3: | ||
= LoRaWAN version = | = LoRaWAN version = | ||
[https://eu1.cloud.thethings.network/console/applications/alpha-omega-tech-hyb/devices/eui-70b3d57ed0053704 alpha-omega-tech-hyb The Things Stack Community Edition Application] | [https://eu1.cloud.thethings.network/console/applications/alpha-omega-tech-hyb/devices/eui-70b3d57ed0053704 alpha-omega-tech-hyb The Things Stack Community Edition Application] | ||
− | + | <!-- | |
== Credentials == | == Credentials == | ||
=== AppEUI, DevEUI and AppKey === | === AppEUI, DevEUI and AppKey === | ||
For ''eui-70b3d57ed0053704'' device at ''alpha-omega-tech-hyb'' application: | For ''eui-70b3d57ed0053704'' device at ''alpha-omega-tech-hyb'' application: | ||
− | static const u1_t PROGMEM APPEUI[8] = { 0x01, 0x00, 0x00, 0x0C, 0x0B, 0x0A, 0x01, 0x05 }; // Little endian format | + | static const u1_t PROGMEM '''APPEUI'''[8] = { 0x01, 0x00, 0x00, 0x0C, 0x0B, 0x0A, 0x01, 0x05 }; ''// Little endian format'' |
− | static const u1_t PROGMEM DEVEUI[8] = { 0x04, 0x37, 0x05, 0xD0, 0x7E, 0xD5, 0xB3, 0x70 }; // Little endian format | + | static const u1_t PROGMEM '''DEVEUI'''[8] = { 0x04, 0x37, 0x05, 0xD0, 0x7E, 0xD5, 0xB3, 0x70 }; ''// Little endian format'' |
− | static const u1_t PROGMEM APPKEY[16] = { 0x65, 0x31, 0x77, 0x83, 0x4D, 0xE7, 0x2E, 0x04, 0x54, 0x9A, 0xB3, 0x63, 0xBA, 0x1F, 0x25, 0xC1 }; // Big endian format | + | static const u1_t PROGMEM '''APPKEY'''[16] = { 0x65, 0x31, 0x77, 0x83, 0x4D, 0xE7, 0x2E, 0x04, 0x54, 0x9A, 0xB3, 0x63, 0xBA, 0x1F, 0x25, 0xC1 }; ''// Big endian format'' |
− | + | --> | |
=== MQTT(S) === | === MQTT(S) === | ||
'''Broker:''' eu1.cloud.thethings.network:8883 | '''Broker:''' eu1.cloud.thethings.network:8883 | ||
'''Username:''' alpha-omega-tech-hyb@ttn | '''Username:''' alpha-omega-tech-hyb@ttn | ||
− | + | <!-- '''API key:''' NNSXS.S52UVHQC54UAR2CMHGFTLNPARYX2VKWKEOE4QMA.QAWCZOCBTDZMMQLCUL7ORXDAOR7IK75MYO5OZHQ37BX346CZUAXA --> | |
'''uplink topic:''' v3/alpha-omega-tech-hyb@ttn/devices/eui-70b3d57ed0053704/up | '''uplink topic:''' v3/alpha-omega-tech-hyb@ttn/devices/eui-70b3d57ed0053704/up | ||
+ | ==== NodeRED flow to get LoRaWAN frame ==== | ||
+ | [https://flows.nodered.org/node/node-red-node-base64 It should be installed base64 node] | ||
− | == Sensors == | + | [[Image:Nodered20220722.png|center|Getting LoRaWAN frame using NodeRED]] |
+ | |||
+ | NodeRED code: [https://www.electronics.cat/alpha-omega-tech/siarqHybrid_20220722.json Getting LoRaWAN frame using NodeRED] | ||
+ | |||
+ | == 48 bytes LoRaWAN frame == | ||
+ | === Sensors === | ||
Modbus baud rate : 4800 bauds | Modbus baud rate : 4800 bauds | ||
+ | '''Noise''' sensor modbus address: 0x01 (Usually it is not connected if there is a CO2 sensor) | ||
+ | |||
+ | '''PM''' sensor modbus address: 0x02 | ||
+ | |||
+ | '''O3''' sensor modbus address: 0x03 | ||
+ | |||
+ | '''NO2''' sensor modbus address: 0x04 | ||
+ | |||
+ | '''CO2''' sensor modbus address: 0x05 (Usually it is not connected if there is a noise sensor) | ||
+ | |||
+ | Byte '''0''': '''CO2''' sensor or '''Noise''' sensor (Most Significant Byte) | ||
+ | Byte '''1''': '''CO2''' sensor or '''Noise''' sensor (Least Significant Byte) | ||
+ | |||
+ | For instance, byte[0]: 0x82 and byte[1]: 0x02 -> 0x0282 = 642 (642'''ppm''' if it is CO2 sensor o 64'''.'''2'''dBA''' if it is a noise sensor) | ||
+ | |||
+ | Byte '''2''': '''PM2.5''' sensor (Most Significant Byte) | ||
+ | Byte '''3''': '''PM2.5''' sensor (Least Significant Byte) | ||
+ | Byte '''4''': '''PM10''' sensor (Most Significant Byte) | ||
+ | Byte '''5''': '''PM10''' sensor (Least Significant Byte) | ||
+ | |||
+ | For instance, byte[2]: 0x0F, byte[3]: 0x00, byte[4]:0x10 and byte[5]: 0x00 -> 0x000F = 15 (PM2.5: 15'''ug/m3''') and 0x0010 = 16 (PM10: 16'''ug/m3''') | ||
+ | |||
+ | Byte '''6''': Temperature's '''O3''' sensor (Most Significant Byte) | ||
+ | Byte '''7''': Temperature's '''O3''' sensor (Least Significant Byte) | ||
+ | Byte '''8''': Relative humidity's '''O3''' sensor (Most Significant Byte) | ||
+ | Byte '''9''': Relative humidity's '''O3''' sensor (Least Significant Byte) | ||
+ | Byte '''10''': Ozone's '''O3''' sensor (Most Significant Byte) | ||
+ | Byte '''11''': Ozone's '''O3''' sensor (Least Significant Byte) | ||
+ | |||
+ | For instance, byte[6]: 0x13, byte[7]: 0x01, byte[8]:0xC1, byte[9]:0x01, byte[10]:0x04 and byte[11]: 0x00 | ||
+ | |||
+ | 0x0113 = 275 (Temperature's value should be divided by 10. T: 27.5'''ºC''') | ||
+ | |||
+ | 0x01C1 = 448 (Relative humidity's value should be divided by 10. RH: 44.8'''%''') | ||
+ | |||
+ | 0x0004 = 4 (Ozone's value should be divided by 1.96. O3: 2.04'''ug/m3''' | ||
+ | |||
+ | Byte '''12''': NO2_WE value from '''NO2''' sensor (Most Significant Byte) | ||
+ | Byte '''13''': NO2_WE value from '''NO2''' sensor (Least Significant Byte) | ||
+ | Byte '''14''': NO2_AE value from '''NO2''' sensor (Most Significant Byte) | ||
+ | Byte '''15''': NO2_AE value from '''NO2''' sensor (Least Significant Byte) | ||
+ | Byte '''16''': SO2_WE value from '''NO2''' sensor (Most Significant Byte) | ||
+ | Byte '''17''': SO2_WE value from '''NO2''' sensor (Least Significant Byte) | ||
+ | Byte '''18''': SO2_AE value from '''NO2''' sensor (Most Significant Byte) | ||
+ | Byte '''19''': SO2_AE value from '''NO2''' sensor (Least Significant Byte) | ||
+ | |||
+ | [https://www.yoctopuce.com/EN/article/computations-in-analog-electrical-sensors NO2 calculus algorithm from NO2_WE and NO2_AE values] | ||
+ | |||
+ | Byte '''20''': Which sensors have been read. (Bit 0: NO2, bit 1: Noise, bit 2: PM, bit 3: O3, bit 4: CO2) | ||
+ | For instance: 0x1D (00011101b -> ''NO2, PM, O3 and CO2'' sensors have been read and ''noise'' has not been read) | ||
− | == Epever's MPPT part == | + | === Epever's MPPT part === |
Modbus baud rate : 115200 bauds | Modbus baud rate : 115200 bauds | ||
+ | |||
+ | [https://www.electronics.cat/alpha-omega-tech/BPLSeriesControllerProtocolv2.5.pdf Epever's MPPT Modbus Commands] | ||
+ | |||
+ | '''SoC''' MPPT modbus register: 0x311A | ||
+ | |||
+ | '''BAT''' MPPT modbus register: 0x331A | ||
+ | |||
+ | '''PV''' MPPT modbus register: 0x3100 | ||
+ | |||
+ | '''LED''' MPPT modbus register: 0x310C | ||
+ | |||
+ | Byte '''21''': '''SoC''' (battery's state of charge) from Epever's MPPT sensor (Most Significant Byte) | ||
+ | Byte '''22''': '''SoC''' (battery's state of charge) from Epever's MPPT sensor (Least Significant Byte) | ||
+ | |||
+ | For instance, byte[21]: 0x4C and byte[22]: 0x00. 0x004C -> 76 (SoC: 76%) | ||
+ | |||
+ | Byte '''23''': '''VBAT''' (battery's voltage) from Epever's MPPT sensor (Most Significant Byte) | ||
+ | Byte '''24''': '''VBAT''' (battery's voltage) from Epever's MPPT sensor (Least Significant Byte) | ||
+ | Byte '''25''': '''IBAT''' (battery's current -Low word-) from Epever's MPPT sensor (Most Significant Byte) | ||
+ | Byte '''26''': '''IBAT''' (battery's current -Low word-) from Epever's MPPT sensor (Least Significant Byte) | ||
+ | Byte '''27''': '''IBAT''' (battery's current -High word-) from Epever's MPPT sensor (Most Significant Byte) | ||
+ | Byte '''28''': '''IBAT''' (battery's current -High word-) from Epever's MPPT sensor (Least Significant Byte) | ||
+ | |||
+ | Byte '''29''': '''vPV''' (photovoltaic panel voltage) from Epever's MPPT sensor (Most Significant Byte) | ||
+ | Byte '''30''': '''vPV''' (photovoltaic panel voltage) from Epever's MPPT sensor (Least Significant Byte) | ||
+ | Byte '''31''': '''iPV''' (photovoltaic panel current) from Epever's MPPT sensor (Most Significant Byte) | ||
+ | Byte '''32''': '''iPV''' (photovoltaic panel current) from Epever's MPPT sensor (Least Significant Byte) | ||
+ | Byte '''33''': '''pPV''' (photovoltaic panel power -Low word-) from Epever's MPPT sensor (Most Significant Byte) | ||
+ | Byte '''34''': '''pPV''' (photovoltaic panel power -Low word-) from Epever's MPPT sensor (Least Significant Byte) | ||
+ | Byte '''35''': '''pPV''' (photovoltaic panel power -High word-) from Epever's MPPT sensor (Most Significant Byte) | ||
+ | Byte '''36''': '''pPV''' (photovoltaic panel power -High word-) from Epever's MPPT sensor (Least Significant Byte) | ||
+ | |||
+ | Byte '''37''': '''vL''' (photovoltaic panel voltage) from Epever's MPPT sensor (Most Significant Byte). ''It has sense in autonomous mode. It is nou used in hybrid mode.'' | ||
+ | Byte '''38''': '''vL''' (photovoltaic panel voltage) from Epever's MPPT sensor (Least Significant Byte) ''It has sense in autonomous mode. It is nou used in hybrid mode.'' | ||
+ | Byte '''39''': '''iL''' (photovoltaic panel current) from Epever's MPPT sensor (Most Significant Byte) ''It has sense in autonomous mode. It is nou used in hybrid mode.'' | ||
+ | Byte '''40''': '''iL''' (photovoltaic panel current) from Epever's MPPT sensor (Least Significant Byte) ''It has sense in autonomous mode. It is nou used in hybrid mode.'' | ||
+ | Byte '''41''': '''pL''' (photovoltaic panel power -Low word-) from Epever's MPPT sensor (Most Significant Byte) ''It has sense in autonomous mode. It is nou used in hybrid mode.'' | ||
+ | Byte '''42''': '''pL''' (photovoltaic panel power -Low word-) from Epever's MPPT sensor (Least Significant Byte) ''It has sense in autonomous mode. It is nou used in hybrid mode.'' | ||
+ | Byte '''43''': '''pL''' (photovoltaic panel power -High word-) from Epever's MPPT sensor (Most Significant Byte) ''It has sense in autonomous mode. It is nou used in hybrid mode.'' | ||
+ | Byte '''44''': '''pL''' (photovoltaic panel power -High word-) from Epever's MPPT sensor (Least Significant Byte) ''It has sense in autonomous mode. It is nou used in hybrid mode.'' | ||
+ | |||
+ | === Hybrid v2.2 part === | ||
+ | Byte '''45''': Information provided by Hybrid v2.2 | ||
+ | * Bit 0: Sensor Low Power Relay State (1: set, 0: reset) | ||
+ | * Bit 1: Sensor High Power Relay State (1: set, 0: reset) | ||
+ | * Bit 2: Access Point Relay State (1: set, 0: reset) | ||
+ | * Bit 3: Power supply (1: plugged, 0: unplugged) | ||
+ | * Bit 4: Photovoltaic panel (1: night, 0: day) | ||
+ | * Bit 5: EXT_WEB connector (1: not shorted, 0: shorted) | ||
+ | * Bit 6: External leds (1: light on, 0: light off) | ||
+ | * Bit 7: Charging battery from mains (1: Battery charging from mains, 0: Battery not charging from mains) | ||
+ | |||
+ | Byte '''46''': Battery voltage read from internal ADC (Most Significant Byte) | ||
+ | Byte '''47''': Battery voltage read from internal ADC (Least Significant Byte) | ||
+ | 2673: 11.13V | ||
+ | 2781: 11.53V | ||
+ | 2915: 12.02V | ||
+ | 3042: 12.50V | ||
+ | 3229: 13.00V | ||
+ | 3380: 13.50V | ||
+ | 3580: 14.00V | ||
+ | |||
+ | = Pictures = | ||
+ | == Plastic box == | ||
+ | [[Image:PlasticBoxHyb00.jpg|center|thumb|Hybrid v2.2 plastic box]] | ||
+ | |||
+ | [[Image:PlasticBoxHyb01.jpg|center|thumb|Hybrid v2.2 plastic box]] | ||
+ | |||
+ | [[Image:PlasticBoxHyb02.jpg|center|thumb|Hybrid v2.2 plastic box]] | ||
+ | |||
+ | == PCB == | ||
+ | [[Image:PcbHyb22Up.jpg|center|thumb|PCB up]] | ||
+ | |||
+ | [[Image:PcbHyb22Down.jpg|center|thumb|PCB down]] | ||
+ | |||
+ | == Programmer position == | ||
+ | [[Image:PrgHyb22.jpg|center|thumb|Programmer red board]] |
Revisió de 23:17, 17 oct 2022
This wiki is written to understand current LoRaWAN protocol being sent by Siarq's Hybrid 2.2 (LoRaWAN version).
Contingut
LoRaWAN version
alpha-omega-tech-hyb The Things Stack Community Edition Application
MQTT(S)
Broker: eu1.cloud.thethings.network:8883 Username: alpha-omega-tech-hyb@ttn uplink topic: v3/alpha-omega-tech-hyb@ttn/devices/eui-70b3d57ed0053704/up
NodeRED flow to get LoRaWAN frame
It should be installed base64 node
NodeRED code: Getting LoRaWAN frame using NodeRED
48 bytes LoRaWAN frame
Sensors
Modbus baud rate : 4800 bauds
Noise sensor modbus address: 0x01 (Usually it is not connected if there is a CO2 sensor)
PM sensor modbus address: 0x02
O3 sensor modbus address: 0x03
NO2 sensor modbus address: 0x04
CO2 sensor modbus address: 0x05 (Usually it is not connected if there is a noise sensor)
Byte 0: CO2 sensor or Noise sensor (Most Significant Byte) Byte 1: CO2 sensor or Noise sensor (Least Significant Byte)
For instance, byte[0]: 0x82 and byte[1]: 0x02 -> 0x0282 = 642 (642ppm if it is CO2 sensor o 64.2dBA if it is a noise sensor)
Byte 2: PM2.5 sensor (Most Significant Byte) Byte 3: PM2.5 sensor (Least Significant Byte) Byte 4: PM10 sensor (Most Significant Byte) Byte 5: PM10 sensor (Least Significant Byte)
For instance, byte[2]: 0x0F, byte[3]: 0x00, byte[4]:0x10 and byte[5]: 0x00 -> 0x000F = 15 (PM2.5: 15ug/m3) and 0x0010 = 16 (PM10: 16ug/m3)
Byte 6: Temperature's O3 sensor (Most Significant Byte) Byte 7: Temperature's O3 sensor (Least Significant Byte) Byte 8: Relative humidity's O3 sensor (Most Significant Byte) Byte 9: Relative humidity's O3 sensor (Least Significant Byte) Byte 10: Ozone's O3 sensor (Most Significant Byte) Byte 11: Ozone's O3 sensor (Least Significant Byte)
For instance, byte[6]: 0x13, byte[7]: 0x01, byte[8]:0xC1, byte[9]:0x01, byte[10]:0x04 and byte[11]: 0x00
0x0113 = 275 (Temperature's value should be divided by 10. T: 27.5ºC)
0x01C1 = 448 (Relative humidity's value should be divided by 10. RH: 44.8%)
0x0004 = 4 (Ozone's value should be divided by 1.96. O3: 2.04ug/m3
Byte 12: NO2_WE value from NO2 sensor (Most Significant Byte) Byte 13: NO2_WE value from NO2 sensor (Least Significant Byte) Byte 14: NO2_AE value from NO2 sensor (Most Significant Byte) Byte 15: NO2_AE value from NO2 sensor (Least Significant Byte) Byte 16: SO2_WE value from NO2 sensor (Most Significant Byte) Byte 17: SO2_WE value from NO2 sensor (Least Significant Byte) Byte 18: SO2_AE value from NO2 sensor (Most Significant Byte) Byte 19: SO2_AE value from NO2 sensor (Least Significant Byte)
NO2 calculus algorithm from NO2_WE and NO2_AE values
Byte 20: Which sensors have been read. (Bit 0: NO2, bit 1: Noise, bit 2: PM, bit 3: O3, bit 4: CO2)
For instance: 0x1D (00011101b -> NO2, PM, O3 and CO2 sensors have been read and noise has not been read)
Epever's MPPT part
Modbus baud rate : 115200 bauds
SoC MPPT modbus register: 0x311A
BAT MPPT modbus register: 0x331A
PV MPPT modbus register: 0x3100
LED MPPT modbus register: 0x310C
Byte 21: SoC (battery's state of charge) from Epever's MPPT sensor (Most Significant Byte) Byte 22: SoC (battery's state of charge) from Epever's MPPT sensor (Least Significant Byte)
For instance, byte[21]: 0x4C and byte[22]: 0x00. 0x004C -> 76 (SoC: 76%)
Byte 23: VBAT (battery's voltage) from Epever's MPPT sensor (Most Significant Byte) Byte 24: VBAT (battery's voltage) from Epever's MPPT sensor (Least Significant Byte) Byte 25: IBAT (battery's current -Low word-) from Epever's MPPT sensor (Most Significant Byte) Byte 26: IBAT (battery's current -Low word-) from Epever's MPPT sensor (Least Significant Byte) Byte 27: IBAT (battery's current -High word-) from Epever's MPPT sensor (Most Significant Byte) Byte 28: IBAT (battery's current -High word-) from Epever's MPPT sensor (Least Significant Byte)
Byte 29: vPV (photovoltaic panel voltage) from Epever's MPPT sensor (Most Significant Byte) Byte 30: vPV (photovoltaic panel voltage) from Epever's MPPT sensor (Least Significant Byte) Byte 31: iPV (photovoltaic panel current) from Epever's MPPT sensor (Most Significant Byte) Byte 32: iPV (photovoltaic panel current) from Epever's MPPT sensor (Least Significant Byte) Byte 33: pPV (photovoltaic panel power -Low word-) from Epever's MPPT sensor (Most Significant Byte) Byte 34: pPV (photovoltaic panel power -Low word-) from Epever's MPPT sensor (Least Significant Byte) Byte 35: pPV (photovoltaic panel power -High word-) from Epever's MPPT sensor (Most Significant Byte) Byte 36: pPV (photovoltaic panel power -High word-) from Epever's MPPT sensor (Least Significant Byte)
Byte 37: vL (photovoltaic panel voltage) from Epever's MPPT sensor (Most Significant Byte). It has sense in autonomous mode. It is nou used in hybrid mode. Byte 38: vL (photovoltaic panel voltage) from Epever's MPPT sensor (Least Significant Byte) It has sense in autonomous mode. It is nou used in hybrid mode. Byte 39: iL (photovoltaic panel current) from Epever's MPPT sensor (Most Significant Byte) It has sense in autonomous mode. It is nou used in hybrid mode. Byte 40: iL (photovoltaic panel current) from Epever's MPPT sensor (Least Significant Byte) It has sense in autonomous mode. It is nou used in hybrid mode. Byte 41: pL (photovoltaic panel power -Low word-) from Epever's MPPT sensor (Most Significant Byte) It has sense in autonomous mode. It is nou used in hybrid mode. Byte 42: pL (photovoltaic panel power -Low word-) from Epever's MPPT sensor (Least Significant Byte) It has sense in autonomous mode. It is nou used in hybrid mode. Byte 43: pL (photovoltaic panel power -High word-) from Epever's MPPT sensor (Most Significant Byte) It has sense in autonomous mode. It is nou used in hybrid mode. Byte 44: pL (photovoltaic panel power -High word-) from Epever's MPPT sensor (Least Significant Byte) It has sense in autonomous mode. It is nou used in hybrid mode.
Hybrid v2.2 part
Byte 45: Information provided by Hybrid v2.2 * Bit 0: Sensor Low Power Relay State (1: set, 0: reset) * Bit 1: Sensor High Power Relay State (1: set, 0: reset) * Bit 2: Access Point Relay State (1: set, 0: reset) * Bit 3: Power supply (1: plugged, 0: unplugged) * Bit 4: Photovoltaic panel (1: night, 0: day) * Bit 5: EXT_WEB connector (1: not shorted, 0: shorted) * Bit 6: External leds (1: light on, 0: light off) * Bit 7: Charging battery from mains (1: Battery charging from mains, 0: Battery not charging from mains)
Byte 46: Battery voltage read from internal ADC (Most Significant Byte) Byte 47: Battery voltage read from internal ADC (Least Significant Byte) 2673: 11.13V 2781: 11.53V 2915: 12.02V 3042: 12.50V 3229: 13.00V 3380: 13.50V 3580: 14.00V