BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

My Garage Door Opener

#22

Thanks Dave. I have very little knowledge so I need to go back and understand that more. I was under the impression that the syncAll applies only if the button is set to switch whereas in my case, it is set to push. Also, I don’t have any problems when I am at home. It’s only when I activate the button, see the gate closing and then drive off. The LCD continues to show “Gate is open” even after I have driven off much longer than it would have taken the gate to close.
Also, I forgot to mention that when I drive off, the app was still active and I was watching the status, meaning, the app did not go to sleep.
Thanks for the pointer.

0 Likes

#23

i have very little knowledge too, but i think my first comment was referring you to re-examining to the examples, most have not much more than:

void loop()
{
   Blynk.run()
}

as the loop,

everything else is in the setup and other function calls - these functions are usually called by the ‘timer’

BUT since you say it works perfectly at home, but this means the code is fine, yes?

0 Likes

#24

Originally I wanted to use timer but I realised there was no virtualWrite so I did not bother to take it out in the setup.
The code works fine ‘at home’. But I am not sure what is the issue that causes the LCD to continue to show the gate is open when it’s not after I drive away from my home. I thought the void loop would continue to check the status of the magnetic switch and update it to closed but looks like something is not working.

0 Likes

#25

The problem is with the phone or the app not sure which one but basically the app incorrectly roams from wifi to cellular.

0 Likes

#26

I did two tests with wifi turned off. On both occasions, the LCD display updated promptly even after I drove off and with the app still opened. So it is likely the issue is the handover from wifi to 3g. Somehow there is a moment of switch over resulting in the status not being updated. I wish there is a fix to this.

0 Likes

#27

Wow this “My Garage Door Opener” has been very active. Anyway, I get this issue that you are talking about, I dont think you ever mentioned which WiFi you are using: 2.4 or 5 GHZ? If I use the 5GHZ i get this issue, so I keep my phone on the 2.4 GHZ. Sometimes the phone does not get connected, so I just close the app, and reopen it again, and this takes care of the problem.

0 Likes

#28

I’m using 2.4 GHZ. Yes, if I let the app time out and reopen, the LCD updates correctly but that’s not user friendly.

0 Likes

#29

Hi @favstuff,
for what you describe, I would think that the hardware sends an “LCD update” message to your phone while the phone is doing the handover from wifi to 3g. While the handover is in place, your phone might be offline for a little short time (maybe 5 seconds?) and I suspect in this time is where your code for the magnetic switch detects the gate is closed and calls the lcd.print().
If this is the case, I would make sure the code that calls the lcd.print() makes the call at least three times at different intervals (let’s say at 10, 15 and 20 seconds, would depend on how fast your phone does the handover to 3g).
I’m not yet familiar with ESPs but in Particle dev kits there is a library called elapsedMillis that would allow you to space your lcd updates so your phone gets the message eventually.
Post back your results please so we all learn!

@ITAlex I agree with you when you say the more garage openers the better, since I believe a garage door opener is a simple, low risk project that allows many of us to enter and experience this addictive IoT game.

Gustavo
PS: @ITAlex thanks for lending us your thread :wink:

0 Likes

#30

Hi Gustavo,
Thank you for your reply.
The time taken for the gate to close is about 17 seconds.
By that time, I could be anywhere from 300-600 metres away I think but I can still see the wifi logo even though I think it has or is in the process of switching to 4g. Even after the switch to 4g the lcd still shows ''open". Once the app times out (60 secs) and I reopen the app, the lcd will now show ‘closed’.
I have already gone ahead and hard wired and soldered everything (big mistake) so I will won’t be taking it apart but should I decide to make a duplicate set, then I will give it a try. Once again, thanks for your inputs.

0 Likes

#31

Hi, I’m sure there’s a misunderstanding here. My suggestion was to change your code in the ESP, not the hardware setup. By adding a retry mechanism in the lcd.print() you avoid the zone where your phone is half in wifi, half in 3g and not reachable. Once it becomes reachable in 3g, the lcd.print() will effect the change in the app.
Or perhaps I misunderstood your problem?
Gustavo.

0 Likes

#32

Hi Gustavo,
No you did not misunderstand. Sorry I did not explain clearly.
I soldered the esp12 to the board and to change the code, I literally have to disconnect everything and desolder. There was also hacking and plastering so it’s no longer easy for me to just take out the chip. It’s good that I made this big mistake so that going forward, I will make sure I can just simply unplug the chip.
Regards,

P.S. Can I change the code via wifi?

0 Likes

#33

@favstuff you can only change the code via WiFi if you have already included the OTA elements within your original sketch, which is unlikely or you wouldn’t be asking the question.

0 Likes

#34

:flushed:
This is the first time I heard about this but thank you very much, I hope OTA elements is something simple.

0 Likes

#35

oh I see.
I don’t deal with ESP’s so I cannot tell whether you can flash them via wifi.
If you cannot, how about soldering some wires to the pins you need in order to flash it, connect these wires to a breadboard and connect your computer USB to it?

Now if you allow me to recommend a board for your next project, try the Photons from Particle.
You can flash them from anywhere via wifi, you can even program them from your browser.

all the best
Gustavo.

0 Likes

#36

Unfortunately I am not able to get access to the chip without ‘surgery’. It has AC live wires for power and is placed in a difficult to access area.
Thank you for your recommendation of Photons. I will certainly take a look.
Cheers!

1 Like

#37

@gusgonnet you can update $3 ESP’s via a web browser, locally or via the internet. Do you have to configure the Photon’s for OTA updates or do they come preconfigured?

@favstuff local OTA via a web browser is fairly straight forward and covered in the sample ESP sketches that are installed when you add the ESP boards to the Arduino IDE.

We would recommend the WeMos D1 Mini as you can have 4 or 5 for the price of a Photon.

0 Likes

#38

Hi Costas, OTA updates come standard in photons AFAIK.
WeMos D1 Mini look very interesting, I am waiting mine to arrive this week, then I would be able to tell what they are like. It’s great to know you can flash them from a browser too. :slight_smile:

out of curiosity, who is “we”?
thanks!
Gustavo.

0 Likes

#39

Bit like the Royal we but I guess my business partner and I.

We do use other ESP’s, like the 7 when we need long range coverage, but our current, general purpose device is the Mini. Hoping they will include the option to add an aerial at some stage.

1 Like

#40

If you need really long range tech you should look into Sub GHz networks. I’m gonna test really soon sth that will give me apron 15-20km coverage:P

0 Likes

#41

Gustavo: I like what you said, addictive IoT game. I remember when I loaded the Blynk Blink sketch, pressed the Buttom widget, and I was able to turned OFF, and ON the LED, bingo! The light turned on in my head. The Blynk folks are genius, great programmers.

Today, I have all kind of IoT projects in my head, that time and money is what I need. :0

1 Like