Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Ivan Grokhotkov
@igrr
regarding proper solution for this, i think it might be better to ask on platformio channel
Faraz Ahmed
@faraz117
Alright thanks :)
marksev1
@marksev1
Got a few hardware related questions. Here: https://community.openhab.org/t/mqtt-ir-transmiter-receiver/9433 he uses a esp-01, while I would use a wemos d1 mini. So he connects the IR-receiver to GPIO0, if I use same gpio (which i think also on wemos d1 mini has a pullup) I don't need to connect additional resistors. What about if I use different GPIO, do I need to connect resistor between gpio and 3.3v? On GPIO3 he connect an amplifier, why is that?
Faraz Ahmed
@faraz117
I have tried to ask this in the platformio channel too . The work around doesnt work because platformio overwrite .pioenvs on every compilation
geman220
@geman220
@skorokithakis Any chance you know of a good tutorial or read on how to get started on learning how to program something like this project?
Stavros Korokithakis
@skorokithakis
@geman220 I don't know a tutorial, but here's my whole source file: https://www.pastery.net/nhmqbp/
i intend to break it up into a small framework so you can have your passwords in a small build script and then your setup and loop will be in a different file
the framework will take care of mqtt/wifi/whatever
so you can write setup/loop after the ESP has connected to the wifi and mqtt server
geman220
@geman220
@skorokithakis Wow, thanks. This will certainly give me a head start.
Stavros Korokithakis
@skorokithakis
no problem, it should be pretty much all you need
it'll connect to mqtt and receive commands
the commands will be like what i have there
"roll up"/"roll down" or whatever you want
i also have a command to do sensible logging to mqtt
in case you don't have a serial console connected
it'll print its IP address and time and things so you don't go hunting
geman220
@geman220
Awesome! So quick question
 if (command == "forward") {
        motor(1, FORWARD, power);
        motor(2, FORWARD, power);
Is that the command that actually moves the servo?
Stavros Korokithakis
@skorokithakis
yes but that's not a servo
i just output a HIGH on a pin
i have a custom bridge
you need a servo library for your thing
there's one built-in, i think
geman220
@geman220
Yea, I think I read about a built-in one
Stavros Korokithakis
@skorokithakis
by the way, you might find this useful: https://github.com/skorokithakis/tiny-ESP8266-breakout
geman220
@geman220

I guess a more accurate question would be would I mainly be editing that area to turn the servo based on MQTT broker messages? Something like

 if (command == "open") {
        servo(1, 180, power);

Or whatever the actual syntax for the servo library is.

Stavros Korokithakis
@skorokithakis
yeah
that just responds to mqtt messages
and has some assorted code to deal with crap i had to deal with during the ages
that's why i was asking @Makuna about the library
i want to make it into a library/framework and put it on github
so people don't have to rewrite all that crap every time
geman220
@geman220
I see. So from what I've been reading so far I should be able to take my solar LiOn 5V2.1A or 5V1A split the power, hook power via USB into the ESP, wire hot/ground to the servo separate and connect 1 data to the servo from the ESP on any data pin I choose. Am I on the right track?
The battery is 10000mah so I believe it should run everything for a while without solar charging, but it has a solar panel on it and it will be facing outside of the window.
Stavros Korokithakis
@skorokithakis
yeah, sounds good to me, as long as they share a ground
maybe you'll find this useful: https://www.stavros.io/notes/hardware/
geman220
@geman220
Awesome, I'll read through this today
Stavros Korokithakis
@skorokithakis
it's just two paragraphs, it'll take two seconds :smile:
geman220
@geman220
Ha I already read that page. I meant the other content on your blog =)
Stavros Korokithakis
@skorokithakis
oh right :P
geman220
@geman220
I'm sure it's going to be a headache to get running at first, but it's always fun to learn something new and make something.
Stavros Korokithakis
@skorokithakis
nah, it's trivial, get platformio
mkdir mything
cd mything
platformio init --board=esp12e
<edit your src/main.ino>
platformio run -t upload
done
geman220
@geman220
Is there a way to emulate a program? Or will I have to wait until my ESPs and servo get here
Stavros Korokithakis
@skorokithakis
you'll have to wait, i'm afraid
which nodemcu did you get?
Stavros Korokithakis
@skorokithakis
ah, that's my favorite
geman220
@geman220
I read online it was the best overall