[SOLVED] Blynk <-> esp-link

I have flashed my ESP8266-01 with esp-link that supports a transparent interface to the UART of my ATmega328 (no Arduino, an ATmega328 under Studio-6 IDE). Is it possible to let Blynk communicate by text commando’s/data to the esp-link/ATmega (in general uart) combination?

Thanks and regards…

It’s very nice that you support a lot of libraries for a lot of hardware. but… is there any documentation how to make contact with a server?

Thanks and regards…

Why not installing Blynk onto the ESP8266, and sending UART commands (anything you like) to the ATMega?
What do you think?
EDIT: Anyway there are some docs here: https://github.com/blynkkk/blynk-library/tree/master/extras/docs

Is there compiled firmware (.bin) for Blynk on the ESP8266? The problem is that a large group of my students are not capable to program/compile firmware for the ESP. It would be very nice if there is a possibility to support a Blynk server on the ESP with an UART interface to any micro controller. I think Blynk in combination with the ESP8266 is a very nice solution to implement a remote control for our first year (Fontys University Venlo, The Netherlands) AEV-bot mobile robot project.

Update:
After some reading (ESP8266-12 blynk wireless temperature LM35 sensor) I understand that it’s not so easy as I thought. To prepare an ESP8266(-01) for communication with Blynk, we have to use the (Arduino) IDE for the ESP8266 to change things like: char auth[] = “xxxxxxxxxx”; //insert here your token generated by Blynk Blynk.begin(auth, “ssid”, “password!”); //insert here your SSID and password.

What do you mean with “sending UART commands (anything you like) to the ATMega?”. By virtual pins control?

Is it possible to compile a general .bin for the ESP8266 that is capable to accept some initialization by something like +++AT… commands to tell the ESP auth, ssid and passwd?

My appreciation for your Blynk project and I like your support very much,

Thanks and regards…

@Wijnand AT commands are not possible once you have Arduino on the ESP8266.

Take a look at WiFiManager https://github.com/tzapu/WiFiManager by @tzapulica
It allows you to add tokens, SSID’s and passwords for existing sketches via a web browser.

Another possibility is to give the firmware of the ESP8266 a tiny HTTP server as esp-link where to initialize some Blynk settings…

Update:
When I was typing, Costas came up… So we have to integrate something like a WiFiManager in the ESP8266 Standalone version? Is it then universal for all targets with a UART? Transparent communication with support for printf and scanf? If virtual pins control do what I think.

@vshymanskyy @Costas

Thanks for your replies. I have read a lot of documents and examples, the problem is that the support for Blynk is that good (boards, libraries), that an “old-fashioned” ANSI C programmer with no experience with Arduino IDE’s (for AVR and/or ESP8266) can’t follow what exactly is going on. I am convinced that Blynk is very usefully, not only educational (interesting for me as lecturer) but also in professional projects. On our Fontys University we like to teach the student in a professional way, modular, hierarchical, reusable with professional IDE’s as Eclipse in general and Studio for AVR (sorry for all Arduino fans, but read the blog of Hack van de Dam on http://www.hackvandedam.nl/blog/?p=762 ). Further: students have no money and time ( yes, for parties but not for hard/soft-ware or how to work with it :wink: ).

Our students starting in the first year with the AEV-bot mobile robot project (see early topic), but also other projects ( intelligent lamps ) are very suitable for IoT. That’s the reason why we are looking for building blocks students can work with. AVR’s Studio IDE is the standard in the curriculum. To control an application (actuators, sensors, speed, position) by a terminal, Labview or Matlab/Simulink is part of a lot of projects. We are using standard ASCII (text) messages (nice for debugging) and a simple CLI (Command Line Interpreter) module. But user interfaces, the use of wifi and/or an introduction IoT came hardly to their attention.

The desired architecture:

  1. We want to start with an existing and working intelligent ( micro-controller ) application. Examples are their AEV-bot, lamp or other projects. Programmed in ANSI C with Studio-6/Eclipse.
  2. Then integrating the interface to internet. Of course the ESP8266 is a very strong candidate. Cheap and small ( easy to integrate with the application as piggy back ). The biggest problem with the ESP8266 is the standard firmware ( AT-commands ) and how to communicate with that protocol. So we started with ESP-LINK ( https://github.com/jeelabs/esp-link ), a transparent bridge between wifi and an UART. Nice is the way they do the setup, the same way as used in the WiFiManager ( integrated HTML-server ). It give us a interface, but not a user interface.
  3. As last the ( graphical ) user interface. Obvious is the smartphone. We have tried NET-IO ( http://netioapp.com/en/ ), it has some benefits if you want use your own styling ( it works with images for background, buttons, sliders, gauges, etc. ) but the number of widgets is limited ( no joystick, oeps ), bad support and no maintenance anymore ( project stopped ). Then we found Blynk, the perfect solution!!!

Now my questions:

  1. I read somewhere in the community that all the communication between Blynk and the application is in ASCII ( text ). Is that right?
  2. If so, is there an overview/list how all the commands and responses look like?
  3. Is it possible to make firmware ( a .bin that can be flashed by the students ) for example the ESP8266-01 ( cheapest ) that has a initialization facility as WiFiManager or ESP-LINK and after that behaves as a transparent bridge for commands and response to an UART?

OK. Hopefully someone can help me. If we have a working environment conform our desired architecture, of course we will share.

Thanks and regards…
Wijnand

1 Like

@Wijnand let me answer.

Yes. We use own simple protocol. And body of it is string.

In link above + here. + Websockets. Yes, it could be better, but this all we have at the moment.

Yes. We are working on that. Very soon (5-6 weeks I hope) we will introduce new widget for that + firmware. And yes, you could do the same by yourself.

2 Likes

@Wijnand can you clarify what you wish your students to do? Are you looking for them to learn how to write commands to microcrontrollers or to get their projects on the internet? I have no idea “what a transparent bridge for commands and response to an UART” means, maybe you could expand on this.

Fortunately I’m not an old time C programmer so I haven’t had to investigate how Blynk works and then announced that it is impossible to control devices without reams of C code.

If people take the time to look there is more than enough information for an average person to be up and running in no time at all. Some argue that more documents would help but it is painfully obvious than many users are not reading the existing documentation. Maybe some of your students want to add to the existing documentation.

If you set up a system and add debug you will see how the communication works and it is as simple as “d w 2 1” for digital write pin 2 high etc. You can also set up a local server and run Blynk so you can dig around inside.

1 Like

Thank god you are following industry standard rather than stupid approach made in Arduino IDE (sorry but because of that I had hard time switching to ANSI C and working in Eclipse).

You can configure Eclipse to use with Arduino just to write “firmware” for ESP that would talk to blink. In my opinion you should force students just to get around concept of classes etc.

@Costas I will try to explain what our goals are, how we have integrated it in our curriculum yet and what to add. First we are working with 3 types of curricula: a. Mechatronics Engineering, b. Mechanics Engineering and c. Industrial Product Design. In the first year we start with the AEV-bot project. This is not really a project, it’s more for skill training. In the mechanical workplace the are building the chassis and the gearbox including the motors. In the electrical workplace they solder the PCB, integrate the electronics with the chassis and test the combination with a test program (as part of the boot loader of the ATmega 328 on the PCB). The last step is to program the robot for a specific behavior with the help of a set modules/function from an existing SDK. Al is done in C ( not C++ because the teams are still in discussion what’s is the best :rage: ) and Studio-6 from Atmel. Students like the project very much. Because they may keep their robots, there is a wish for a follow up in the second year with the goal to introduce wireless remote control and IoT. Extending the robot with sensors and add remote control/monitor (sensors for position, temperature etc.) functions. They all have a smartphone, but… none of the students have program experience on the level of programming in the way the Blynk projects do. So we think of a couple of hard/software building blocks. Blynk as GUI, ESP8266 as (transparent) WiFi bridge (custom firmware) and a CLI ( Command Line Interpreter ) on the micro controller to decode the commands coming from Blynk ( call the existing functions for activators and sensors ) and send the response back to Blynk. Those building blocks must be so easy to use that also a Industrial Product Design student ( more an artist as an engineer ) can handle it.

@conkerkh What’s your background? Working in the field ( industry )?

I’ve finished Mechanical Engineering, but I’m sorta continuing to develop myself more into control and embedded systems. Possibly I’m looking for PhD doing torque vectoring systems for electric cars but we will see. It mostly depends on if I’m gonna get funding or not.

@Wijnand I don’t think your students would have any problem with the Arduino IDE and Blynk as long as they have a lecturer that knows their way around the software.

Purists might not like the Arduino IDE but for your particular students I think it fits well.

@Costas No, they would have any problems with the Arduino IDE, in the Netherlands ( and over the whole world ) Arduino hardware and Arduino IDE is very popular on high schools and very nice to make an introduction in programming. We support this environment for high schools by helping them to interface it to specific applications. But… it is not the industry standard. On industry and so also on university level, it’s not grabbing some libraries and hope it will work. Reading the questions in this community, a lot of people ( I’m also at ) don’t know what they are doing. But that’s another ( important ) discussion.

B.t.w. I am not a purist ( in favour of OOP :wink: ), only old-fashioned ( born in 1950 ).

B.t.w. 2: Today I got my “Sparkfun ESP8266 Thing” and are planning to start with the Arduino IDE for ESP8266. Never too old to learn.

Arduino IDE wouldn’t pass any standards whatsoever. What is more scary though I know a lot of formula student teams use it as a controller for motors. No wonder that scruteneering is so hard on them cause I would be scared to see what can happen… WHAT IS MISRA C??? I would actually consider HAL implemented for ESP safer and better than Arduino HAL, so apart from the fact that Arduino IDE is worst programming environment ever. It’s perfectly safe to use it with ESP for non industrial solutions.

I think ‘worst programming environment ever’ is just an opinion.

A Colombian STUDENT in Italy came up with Arduino in 2004 as a way to create inexpensive and simple tools for non-engineers to create digital projects.

In my book it has been a huge success and therefore a very good programming environment.

Hi,

I’m keen to know more details about why Arduino IDE is not great. Then also what should we be using that is better?

I am coming from a trade/engineering background and am used to working with PLC’s in industry but for ‘playtime’ at home have been using Arduino.

Well okay guys. It’s up to you what you want to use. I use Eclipse for normal embedded programming and it’s far more superior than Arduino IDE that it’s not even worth to discuss it’s advantages. This clearly explains what Arduino IDE lacks: http://kig.re/2014/08/02/arduino-ide-alternatives.html. As to some other things. OH yeah and CLion is cool for development, Atom, Atmel Studio, Keil, IAR.

Arduino abstracs hardware layer to unheard levels, this where lies it’s strength and weakness at the same time. This is also how people get bad habits. Unfortunately I had hard time moving from Arduino to STM32, where you need to configure Interrupts, Clock, DMA Channels, Clocks etc, the results are much better. On the other hand most likely if I wouldn’t use Arduino at the beginning I might never get into this at all so it’s hard to say if its that terrible. Yes on one hand it’s a success and great tool on the other not really. I would say that if you are looking for let’s say casual projects not so complicated that you plan to do from time to time, without any plans in the future to move to more advanced micro controllers Arduino seems to be great fit, but if you want to do something more then it might become problem later.

1 Like