Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Stavros Korokithakis
@skorokithakis
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
Stavros Korokithakis
@skorokithakis
i should probably buy a few more
yeah it is
geman220
@geman220
I actually did SOME research =P
Stavros Korokithakis
@skorokithakis
haha
geman220
@geman220
Should platformio have made the src/main.ino?
Stavros Korokithakis
@skorokithakis
i don't think it does
just use mine
geman220
@geman220
Ah okay just making sure I didn't miss something
Stavros Korokithakis
@skorokithakis
nope, i think it makes one if you use the blink template
you can use templates, i seem to recall
hey, @ivankravets, can i use a git repo as a template? i'd like to do something like platformio init --from-repo=git@github.com:skorokithakis/wifi-template.git
geman220
@geman220

Where are these includes in your program coming from?

#include "PubSubClient.h"
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <DHT.h>

Do I need to physically get those? Are they just default Arudino IDE libraries? If so I can just look up the included servo library and add it correct?

Stavros Korokithakis
@skorokithakis
oh yes, sec
add to your platformio.ini: