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
but that looks interesting
geman220
@geman220
@skorokithakis I plan to leave the potentionmeter unless I need it to rotate more. Or I'll buy a new servo that has full rotation
Stavros Korokithakis
@skorokithakis
@geman220 yeah, i think that's a better solution
@geman220 how many D1s did you get?
geman220
@geman220
10
Stavros Korokithakis
@skorokithakis
haha, great
i was going to tell you to get 3-4 because you might fry a few, but 10 is good
geman220
@geman220
I need 6 to work on my first order so I can get downstairs completed. I need 10 total so if I'm lucky I don't fry any, if I'm unlucky I have 4 spare and I can make a second order

@skorokithakis so I hacked up your code and I do realize there is a lot of dead useless code now but I don't want to remove anything until I can test and go step by step through my "cleaning" here is what I have https://www.pastery.net/zegxhg/ . Notice anything that is glaringly wrong? Also to verify

WiFiClient wclient;
char COMMAND_TOPIC[] = "rccar/" NAME "/command";
char STATE_TOPIC[] = "rccar/" NAME "/state";
char LOG_TOPIC[] = "rccar/" NAME "/log";

Command_topic would be rccar/command so rccar is the name and command is the topic correct?

geman220
@geman220
And don't I need a username / password to connect to the MQTT topic?
Stavros Korokithakis
@skorokithakis
oh sorry
hmm
that's the old code
i replaced rccar
sec
that's the problem with not having a library
i have to hunt down the latest version of this code
project name is something like "shutters"
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?