PICmicrochip/ESP8266 - i2c communication

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
silenzo
Normal user
Posts: 3
Joined: 07 Mar 2017, 19:30

PICmicrochip/ESP8266 - i2c communication

#1 Post by silenzo » 07 Mar 2017, 20:20

Hello,

I'm creating a little project of mine, for which I need to establish communication between microchip (any ie. 16f1937 or faster 18f4550) to pass commands send from domoticz/openhab or other source and perform certain actions.
Since I havent succeded so far with that, I created simple and very early version of light driver based on PWM code, which turns ON and OFF 8 light points in the room, one by one from 0 to 100% of brightness. ESP sets 0 or 1 on one of the GPIO pins, and PIC chip based on the state of that pin drives PWM accordingly to animate lights. But I'd like to add more sequences/scenarios for turning lights ON and OFF, and attach more lights/LED strips to the same PIC controller. Using pin states is not possible, as I'd run out of pins very soon. So I need to pass commands via i2c, and here's where I need some help/direction how to do this easly.

Is there a way to achieve that using any of the existing plugins in ESPeasy or do I rather need to make new custom plugin? PIC controller I'll handle, at least I think so ;)

JustmeNL
Normal user
Posts: 26
Joined: 09 Dec 2016, 23:10

Re: PICmicrochip/ESP8266 - i2c communication

#2 Post by JustmeNL » 07 Mar 2017, 20:30

Hi,

You could use the ser2net plugin and send the data using serial?
Script it from Domoticz and send it to the pic through espeasy.

paxi
Normal user
Posts: 121
Joined: 02 Feb 2017, 00:48
Location: Germany

Re: PICmicrochip/ESP8266 - i2c communication

#3 Post by paxi » 08 Mar 2017, 13:00

Using a PWM expander seems easier and is implemented in ESPEasy. ;)

silenzo
Normal user
Posts: 3
Joined: 07 Mar 2017, 19:30

Re: PICmicrochip/ESP8266 - i2c communication

#4 Post by silenzo » 08 Mar 2017, 18:46

PWM expander is some solution but it would be tricky to code all those scenarios and animate lights on all channels to work without a glitch. It's good to set PWM level and forget about it, but acting according to lookup table or incrementation would fail I think. Besides PIC can do much more than PWM, while ESP is for communication and basic sensors.

Ser2net seems to be ok, but... I dont know how to get it to work yet. Need to educate myself a bit.
But still would be nice to have some kind of generic and configurable i2c plugin for custom devices and MCUs.

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests