Jump to content

Arduino_MQTT to the Non Production


Recommended Posts

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.

Link to comment
  • 3 weeks later...

@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
Link to comment

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.

 

  • Thanks 1
Link to comment

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.

Link to comment

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.

Link to comment

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.

Link to comment

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
 

Link to comment

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

Link to comment

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.

  • Thanks 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...