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
instance name is something like "living room"
mqtt auth will change depending on your setup, mine is on my lan, so i don't have it authed
hmm
geman220
@geman220
I could set up MQTT on my LAN. Right now I use HASS and CloudMQTT but HASS has a built in local MQTT so I could just move to that
I only use MQTT currently for device tracking so no big deal
char COMMAND_TOPIC[] = PROJECT_NAME "blinds" INSTANCE_NAME "/command";
char STATE_TOPIC[] = PROJECT_NAME "blinds" INSTANCE_NAME "/state";
char LOG_TOPIC[] = PROJECT_NAME "blinds" INSTANCE_NAME "/log";
So in MQTT I make the name "blinds" and the topic inside of blinds command, state, and log. Correct?
geman220
@geman220
Or I could just install Mosquitto
Stavros Korokithakis
@skorokithakis
just define the vars
here:
stick that in build.sh
i use it to avoid defining my secrets in the file
basically this q/a is making me realize i should make this a proper framework with a readme that people can clone and use
geman220
@geman220
But then you wouldn't have to sit in a chat all day answering Q/A! =)
Stavros Korokithakis
@skorokithakis
haha
skorokithakis @skorokithakis runs off quickly to write the framework
geman220
@geman220
Other than defining the var in build.sh to avoid having passwords / information in the main.ino is there any reason to do it? I ask because since I am just starting out I like to keep things together in one spot as best I can, it helps me understand the logic and flow. Once I am more comfortable with what I am doing I then split out things into includes etc.
When I was learning YAML for HASS I had one really long 2000+ line config for like 2 months until I was comfortable with what I was doing. Then I split everything up so it's actually manageable now, for example.
Stavros Korokithakis
@skorokithakis
no, no other reason
i just like to publish my code and secrets in the code were non-great
plus this way i can reuse the code
geman220
@geman220
Yea makes more sense. I'll clean it up once I'm more comfortable with what I'm doing.
I went ahead and setup Mosquitto to make things easier and migrated my device tracker over
I'm not certain but just publishing to a topic also creates the topic correct? So really now that I have Mosquitto up and running and working I don't need to modify anything I can just let the publisher create the topic blinds/command
Stavros Korokithakis
@skorokithakis
yeah, just publish
you can also listen to things like
blinds/#
and it will listen to all messages under blinds
geman220
@geman220
Okay, now the waiting game to get my ESPs =(
Stavros Korokithakis
@skorokithakis
yeah, that's always the worst part :/
geman220
@geman220
So if I remove the potentiometer just to do a basic proof of concept, I should be able to set a delay then stop the servo after the delay correct?
Stavros Korokithakis
@skorokithakis
i am not sure at all about that
possibly?
geman220
@geman220
Ha okay I'll look around online
Michael Miller
@Makuna
@geman220 using timing is not a safe approach, you really need sensors and stop on sensor. Voltage variance will effect the speed of the servo.
geman220
@geman220
=( more complexity
Michael Miller
@Makuna
if you are using unmodified servos, then it has an internal sensor for position so you can set it and forget. If you disable the internal sensor for continuous mode, then you need external sensors.
geman220
@geman220
Okay so I just need a continuous servo
Michael Miller
@Makuna
continuous servos either ignore the internal sensor or have it disabled when shipped, so you then have to have an external sensor.
CHAE-PIL LIM
@chaeplin
https://twitter.com/mydailyview/status/722476960761249793 It's direct image posting. Just for fun. esp-01 to twitter.
geman220
@geman220
So essentially there is no way turn open/close blinds unless I get some sort of other sensor to tell it when to stop turning
Unless by some miracle 180 degrees is enough
Michael Miller
@Makuna
@geman220 well, close to correct. More precisely, if a servo with internal sensor does not support the range of motion you need, then you will need external sensors. There are servos that do extended ranges and often most will do 200 degrees. To use them, you will need to then use the writeMicroseconds() method instead. The servo library is written to compatible with the normal Arduino library, so you can use their docs for reference.
geman220
@geman220
Oh well that makes me feel much better =]. I'll probably look into getting servos that go up to 200 and use the method you mentioned.
Michael Miller
@Makuna
@geman220 Yours may already go to 200, try them with the writeMicroseconds() first.
geman220
@geman220
@Makuna so instead of myservo.write(180); do myservo.writeMicroseconds(200);
I just looked my servo up it moves 180
Stavros Korokithakis
@skorokithakis
so i want to make this boilerplate framework for the ESP and i need a place to put my settings
what's a good place for that? something like settings.h?
i'm afraid my C knowledge isn't great