How to get typed string from App to hardware (ESP8266)

Hello,
I am looking for a solution to transfer a string from my App, which I want type in on my phone to my hardware, once in a while (1 time in 3 months e.g.). At the moment I see the only possibility by Terminal Widget but I would prefer not to have that widget on my dashboard which I wouldn’t use 99,9 % of the time.
What about the Menu Widget. Is there a possibility to read the labels? In that way I just could add one item for my strings.

Thanks in advance

LCD widget?

You could use the button widget to turn on a webserver on the ESP for the 0.1% of time that you need to enter a String.

@Darwini is that random string or predefined? If predefined menu will fit your needs.

Thanks for the replies.
@Dave1829 I think LCD works only direction hardware to App. No possibilities to enter a random string.
@Costas That does not help because my hardware is behind a router I cant change any settings (portforwarding and so on) and my App is somewhere in the world.
@Dmitriy Unfortunately they are random strings. Is there no way to read the properties (labels values) of the Menu Widget?

@Darwini when you say random Strings, how random is random? What does the ESP do with the “random” String?

Which ESP are you using? Most have 3MB of SPIFFS so you could store tens of thousands of Strings in SPIFFS and use Blynk to recover a particular String when you need it.

I think I first found Blynk because I use WISP and that doesn’t have port forwarding. There are ways around port forwarding and I have seen several systems (mainly for the Raspberry Pi) that give access to your hardware without modifications to the router. A good example of this are the video streaming sites provided with many webcams etc.

You could also look at OTA updates of the remote ESP via a server so the OTA could contain the new String you require. This might not work for your specific project as you have indicated you want to enter the String via your Smartphone and that’s not really how OTA updates work.

No. But you can write values to menu widget.

Thanks for your reply.
@Costas Actually it is a link to a file with some data inside but the location of the file can change. Therefore I need to have the possibility to modify that string. That means it can be unpredictable numbers and letters.
The string “http://www.” I can predefine but the rest I need to add in my app.
Any ideas are very welcome. For now I see the only possibility to use the Terminal widget.
Thanks in advance for your help.

Terminal widget is certainly the easiest way to do this and you can hide it on an “unused” tab (if you have one) .

May I ask how you determine the full url for the file location?

1 Like

I will get the url via email, sms or messenger (Telegram e.g.)
For now I do it as you have suggested via Terminal widget and hide it on another tab.
I was hoping to can do it via menu widget I use already, but unfortunately not.
Thanks for your help and ideas.

Would you not have access to your IDE when you get the full url details to then be able to do a webserver OTA update?

You can add terminal widget to your dashboard when you need it,or you can just use Tab for terminal.

1 Like

Never thought of that. As long as the code is in your sketch you can add and subtract widgets at will.
Only problem is if your 4 tabs are already full. Guess you could clear a few widgets for the 0.1% when you need Terminal.

That’s how i handle my widgets while i suffer from low energy :sweat_smile:

Thanks for the replies
@Costas Yes I will have full access to my IDE but not to the hardware because the hardware is in Spain and I am half of the year somewhere in the world.
At the moment I cant send anything to the ESP12F except Blynk-Data via Blynk-Cloud. I dont know how to establish a connection to the ESP12F. I am not familiar with that topic, especially how to connect a local IP behind a router which settings I cant change and I dont know.

@elanozturk Good idea. If it’s working in this way then its better for me to add the Terminal-widget for 5 minutes to send the string and afterwards delete it again than use the Tabs because other people use the project but shall not have access to the Terminal even not accidentally

Thanks again too all for sharing your thoughts and ideas. It helps a lot to find a better solution.

You don’t need direct access to the hardware in Spain. With the IDE you upload a new bin file (sketch in compiled form) to a webserver and when you click a Blynk button the hardware in Spain flashes the new firmware from the webserver.

Now Blynk is a household name then a user could add the widget themselves. If it’s important add a pin number in your sketch tied to the Terminal widget.

@Costas Thanks for your ambitious help. Do you have example-code for the Button initiated update and more important to me an example for a free webserver I can use for the up-and dowload of my small file without the need to setup my own server.
Related to the Terminal-widget: The other people have only shared access to my project without possibilty to add or delete something.

This is how you can do it with button:

BLYNK_WRITE(V1)
{
  int pinData = param.asInt();
  if (pinData == 1)
  {
    WebUpdateButton();
  }
}

Tomorrow i am going to share my OTA over webserver sketch in Projects made with Blynk section,you can check and re-design the code for your needs.

2 Likes

We use various commercial web hosting services and one allows us unlimted sites for a nominal monthly sum.

Until recently you could host websites for free on Google Drive but it was closed down in August.

A list of free hosting providers are available at http://www.hostingadvice.com/how-to/free-web-hosting/

1 Like