Kevin Posted October 10, 2023 Posted October 10, 2023 This BETA version and is used to add node service to an Adruino project. works with ISYarduin.h and can be added to your lib dir. It was written for my use in making projects and will have limited support. But if you have any questions please email me at kevin@kevin-graff.com I will be happy to help. Also feel free to change and modify and parts to fit your needs in both programs. The ISYarduino.h file can ether be in your LIB or just in your currient folder https://github.com/n2uns/ISYandrino Please report any problems to me in by email or the Form but I don't follow the form offten. Thanks and good luck. Quote
Kevin Posted October 11, 2023 Author Posted October 11, 2023 I found that when you install the node server you need an Arduino running with the LIB connected to the broker or the node server will time out waiting for the discovery. 1 Quote
Kevin Posted October 16, 2023 Author Posted October 16, 2023 Tested on Wemos D1 R3 gives warnings but compiles and works Quote
Kevin Posted October 17, 2023 Author Posted October 17, 2023 Added a simple Arduino program for the SONOFF 4CH Pro see read me for flashing https://github.com/n2uns/ISYandrino Quote
jkosharek Posted November 7, 2023 Posted November 7, 2023 @kevin Trying to configure this Node to connect to a Mini ESP8266 Board similar to what @EWhite did for the chicken coupe. I have the device and the node configured but am getting this in the log, any ideas: 2023-11-06 19:04:17,805 MainThread udi_interface ERROR udi_interface:write: Traceback (most recent call last): File "/var/polyglot/pg3/ns/0021b9025fc4_14/main.py", line 625, in <module> Controller(polyglot, 'controller', 'controller', 'Arduino MQTT') File "/var/polyglot/pg3/ns/0021b9025fc4_14/main.py", line 91, in __init__ self.mqttc.connect(self.mqtt_server, self.mqtt_port, 60) File "/var/polyglot/pg3/ns/0021b9025fc4_14/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 914, in connect return self.reconnect() File "/var/polyglot/pg3/ns/0021b9025fc4_14/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1044, in reconnect sock = self._create_socket_connection() File "/var/polyglot/pg3/ns/0021b9025fc4_14/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source) File "/usr/local/lib/python3.9/socket.py", line 844, in create_connection raise err File "/usr/local/lib/python3.9/socket.py", line 832, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 61] Connection refused Quote
Kevin Posted November 7, 2023 Author Posted November 7, 2023 Hi, In your config file what is the ip address and port your are using? For me it is mqtt_server 192.168.18.185 and mqtt_port 1884 these are the ip and port for the eisy and polisy built in mqtt broker. 1 Quote
jkosharek Posted November 7, 2023 Posted November 7, 2023 Ok, that was wrong on my setup. I thought the mqtt_server was the SP8266 Board. The SP8266 Board seems to be connected to the Arduino_Mqtt now but it didn't create node(s) under 'Nodes' in PG3x nor in the Admin Console. I assume it should? Quote
Kevin Posted November 7, 2023 Author Posted November 7, 2023 if it is responding to the discovery . but after the nodserver runs and dose the discover the admin has to be restarted. for the to repropagate . also it only makes one NS for each ESP board. any time you make changes to your ESP board ie add inputs or out puts you need to do a rediscover and restart the admin console. Quote
jkosharek Posted November 7, 2023 Posted November 7, 2023 Where is the discover done? The Arduino_Mqtt node doesn't have discover option and Arduino_Mqtt node didn't create a parent node in the admin console which would normally have a discover button. Quote
Kevin Posted November 7, 2023 Author Posted November 7, 2023 The first discovery is done on the NS start up. But you have to have the ESP Board up and running before you start the NS. it makes a node in the admin by default named Arduino_Mqtt in that node is the rediscover button. Quote
jkosharek Posted November 7, 2023 Posted November 7, 2023 The ESP was up and running, I deleted the node and reinstalled/configured and it didn't create the node. what should be in mqtt_user and mqtt_password? Quote
Kevin Posted November 7, 2023 Author Posted November 7, 2023 I was told it dose not matter. To be hornist with you I only understand about half of the program I wrote. LOL I am a hardware person and most of it was done with copy and past. I used a program called MQTT_Explorer that is a free download if you have it connect to your ISY MQTT you can watch the transactions between you ESP and the NS. The node server should send a "1" to the topic of Discover and the ESP should responds with a list of your Analog in and out along with the names you gave the also the Digtal in and out, After that The esp should send a Status topic every time an in put or output changes. Quote
jkosharek Posted November 7, 2023 Posted November 7, 2023 I guess I am a little confused how this is supposed to work. I have an EISY running PG3x where Arduino_Mqtt is installed. The Arduino_Mqtt node has config options are the values for the ESP Board info or EISY: mqtt_server mqtt_port mqtt_user mqtt_password mqtt_topic and the ESP Board has these config options: Host Port Client User Password Topic Full Topic Quote
Kevin Posted November 7, 2023 Author Posted November 7, 2023 the mqtt_***** are all the ISY Mqtt broker settings. mqtt_topic is the name of you ESP and needs to match. I don't know about your ESP settings If you look at my https://github.com/n2uns/ISYandrino you will see the diffrent progroms I worte for some of my boards. It uses the ESPMQTT lib and some addtions I have int the .h file. The main one I am useing is the shed program but the https://github.com/n2uns/ISYandrino/tree/main/sonoff4chpror3 Uses an ESP8266 Quote
jkosharek Posted November 7, 2023 Posted November 7, 2023 Looks like the ESP Board is sending data to EISY MQTT (10.11.12.9) My Quote
Kevin Posted November 7, 2023 Author Posted November 7, 2023 Ok that is the problem. You are using Tsmota and my node server will not work with it as it is. You should be using MQTT by xking in the production store it was written for that. I created my own Arduino lib for my NS, I didn't care for the Tsmota for the hardware I was building. I don't use SonOFF I use ESP surfs mount modules on my boards that I build. 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.