News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

MQTT on Pic 18F47K40

Started by Dave-S, Nov 08, 2023, 03:00 PM

Previous topic - Next topic

Dave-S

Any way to access a MQTT Broker from a 18F47K40, lots of info about using ESP8266 but all with Arduino?

ChrisRowe

Hi Dave,
I use an esp8266 loaded with tasmota using  serial mode to access my node red broker from an pic chip.
 I have also programmed a couple of ESP8266 using Arduinio ...yuk not my favourite programing environment.
Tasmota is free and is very easy to load onto esp8266 or ESP32. It has an inbuilt webserver to set up MQTT and other parameters. The serial interface will work up to 115200.
https://tasmota.github.io/docs/

regards
Chris

Dave-S

Many thanks for the reply.
How on the pic do you reference it, do you just send/recieve code via the serial port.
How do you set up Broker detials, is this programmed into the tasmota.bin or sent from the pic.
Do you have any example code tasmota/pic.
Thanks David

ChrisRowe

Hi David,
All the MQTT work is done in the tasmota firmware. I have attached a couple of screen shots of the set up screens.
You just need to send serial into what ever ESP8266 pins you want to use as RX/TX. You set up the baudrate and send type via the web browser.
 The original tasmota was developed to allow people to hack sonoff devices but has been expanded. You can connect sensors etc to the esp8266 GPIO pins tell tasmota what pin and what device.  It will read the device and send the data back to your MQTT broker or you can set a GPIO pin using MQTT. Its a nice piece of code. Lots of stuff on internet.

regards
Chris

Dave-S

Hi, Chis
Many thanks for the information. Have been going through information on the Tasmota website and getting to know how it works.  I just want to get the data from Solar Assistant MQTT Broker.

Thanks David