zbx-sadman / zabbuino

Zabbix agent for Arduino
92 stars 14 forks source link

Zabbuino does not work with Zabbix 4.0 because the plain text protocol was abandoned #9

Closed e-alfred closed 5 years ago

e-alfred commented 5 years ago

Hello,

Zabbix 4.0 abandoned the plain text protocol, all agents need a header now:

https://www.zabbix.com/documentation/4.0/manual/appendix/protocols/header_datalen

This means Zabbuino does not work with the zabbix_get command anymore for example. Also, retrieving data from an agent does not work anymore.

zbx-sadman commented 5 years ago

Hi, e-alfred

Zabbuino can detect Zabbix v4 protocol since Aug 2018, v1.3: https://github.com/zbx-sadman/Zabbuino/tree/experimental

Unfortunately i can't release now this branch because i still using Zabbix v3.x, and can't complete long test with sensor sets (all my Nano's is used into other project for some months). But i maked separate tests with all sensors, what i have, and with _zabbixget utility from Zabbix v4 pack.

I will be grateful if you do testing Zabbuino 1.3 in Zabbix v4 environment and give me feedback.

Note that some command syntax has been changed: https://github.com/zbx-sadman/zabbuino/wiki/Zabbuino-in-Russian-(for-release-1.3.x) (Russian only).

e-alfred commented 5 years ago

Awesome, great work! I didn't take a look at the experimental branch and its commits though so I missed that.

I will flash one of my Arduino devices with it and see how it works. Any chance the Russian wiki page can be translated at some point? My Russian isn't that good, but aside from that I think it would open up the project to a lot more people.

zbx-sadman commented 5 years ago

Any chance the Russian wiki page can be translated at some point?

It can be done by someone's, who know English better than me armed with a Google Translate tools.

You can help to project? I can additional explain the meaning of the phrases from the manual, if they are incomprehensible.

e-alfred commented 5 years ago

Okay, I tried to compile the experimental branch but got stuck with this error. It seems to come from a new sensor added recently to the source code.

sketch\src\i2c_mlx90614.cpp: In function 'uint8_t makePecWrite(uint8_t, uint8_t, uint8_t, uint8_t)':

sketch\src\i2c_mlx90614.cpp:31:28: error: 'value' was not declared in this scope

   pec = mlx90614crc8(pec,  value[0]);

                            ^

sketch\src\i2c_mlx90614.cpp: At global scope:

sketch\src\i2c_mlx90614.cpp:36:2: error: expected unqualified-id before '/' token

 */

  ^

sketch\src\i2c_mlx90614.cpp:36:2: error: expected constructor, destructor, or type conversion before '/' token

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.
zbx-sadman commented 5 years ago

Ough.

Just lost /* before static uint8_t makePecWrite

Quick fix done.

e-alfred commented 5 years ago

I tested the Zabbuino experimental branch successfully on both Uno and Mega devices with the 5100 Ethernet shield and a few sensors (mainly DHT22) using Zabbix 4.0. I found two problems:

zbx-sadman commented 5 years ago

0) Thanks to testing. 1) My bad. I've using Windows way. Can you change #include <util\atomic.h> to #include <util/atomic.h> in the head of actuators.cpp and recompile firmware under Linux? 2) Conceptually Zabbuino working in "Shot and forgot" style. Firmware makes no more additional operation after sending buffer to the HD44780 controller because remembers nothing about connected hardware. However, you can write user plugin function (since v1.3) to achieve your goals. I think that need send to the display 0x1E / 0x18 command code periodically. You can find all available commands there: http://www.dinceraydin.com/lcd/commands.htm

zbx-sadman commented 5 years ago

Release v1.3 moved to master branch