ESP8266-01 with python for mqtt

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello everyone,

 

I would like to share a problem with you guys so i can make something what i want to do, i am using esp8266-01 the basic model with arduino uno atmega328p.

 

I already installed python on my esp8266-01 and now i want to interface atmega328p with esp8266. But due to less knowledge about python i am unable to do that.

so if anyone can help me about this that will be beneficial for me.

 

My main moto is to use io.adafruit as an broker so i can communicate with my esp from anywhere via android app or dashboard of io.adafruit and my esp can communicate serially with arduino controller to do specific assigned task according to received data.

 

Thanks.

 

Manish verma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As far as the AVR is concerned, surely it's simply a matter of sending serial commands to the ESP, and receiving the responses?

 

None of the rest of it has anything to do with AVR - so probably best to go to either the Adafruit forums or the Arduino forums ...

 

Or the ESP8266 / ESP32 forums...

https://bbs.espressif.com/

https://www.esp8266.com/ucp.php?mode=login

 

As for Python, there are plenty of books & tutorials available

 

https://www.python.org/

 

https://www.python.org/about/gettingstarted/

 

 

EDIT

 

It seems like just about every time I look at any video on YouTube, I get the advert for this:

 

Udemy wrote:

Complete Python Bootcamp: Go from zero to hero in Python 3

Learn Python like a Professional! Start from the basics and go all the way to creating your own applications and games!

BEST SELLER

 

https://www.udemy.com/complete-python-bootcamp/

 

So maybe you could give that a try?

 

I've never done a Udemy "course", so I have no idea what they's actually like - it just seemed topical

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Thu. May 10, 2018 - 07:44 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks for help. 

and esp8266 form is dead already as per my knowledge, apart from this i just need some tips on communication with atmega328p and esp which is not possible for me coz of some lack of knowledge.

But thanks anyways for lead. 

Manish verma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

staring.net@gmail.com wrote:
i just need some tips on communication with atmega328p and esp which is not possible for me coz of some lack of knowledge.

Again, that is just basic serial comms - nothing specifically to do with the ESP.

 

So take a step back; put the ESP aside for a while, and spend some time getting to grips with the basics of serial comms with an AVR.

 

The easiest way to do this is to just connect your AVR to a PC, and use a terminal program on the PC to see what the AVR is sending, and to manually send stuff back to it.

 

There are plenty of tutorials on doing this; eg, https://learn.sparkfun.com/tutorials/serial-communication/all

 

This is foundational - "Microcontrollers 101" - so you really need to get  solid understanding of this before moving on to high-level stuff like MQTT, cloud connections, etc, etc, ...

 

 

EDIT

 

Hang on - haven't we been through all this before: https://www.avrfreaks.net/commen...

 

frown

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Thu. May 10, 2018 - 09:26 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Not quite sure why you want to install Python on your ESP. or why you want to use another Arduino to talk to th ESP, considering it can run the Arduino "system" anyway.

I have, in the past, used a simple ESP8266 running the Arduino core, and I did use the Adafruit broker(albeit briefly). In my opinion, the ESP8266 forum is far from dead, and I reckon it would be a better place to ask your questions.

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:
Not quite sure why you want to install Python on your ESP. or why you want to use another Arduino to talk to th ESP, considering it can run the Arduino "system" anyway.

+1

 

John_A_Brown wrote:
In my opinion, the (sic) ESP8266 forum is far from dead,

Note that there are two forums - one from ESP themselves, and a "community" forum:

 

https://bbs.espressif.com/

https://www.esp8266.com/ucp.php?mode=login

 

So I guess we need to be clear which one we're talking about?

 

Quote:
and I reckon it would be a better place to ask your questions.

Certainly for ESP-specific questions - but not for the basics of how to do serial comms on an AVR ...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I was talking about the community forum, and, if the OP was to look at running the entire project on the ESP, then the serial questions probably evaporate.

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

staring.net@gmail.com wrote:
my esp can communicate serially with arduino controller to do specific assigned task according to received data.

Write your project down in specific detail, then break down each step and solve them one at a time.

Start by using a usbtty cable between your pc and the arduino uno, and work out what commands will be needed to "do specific assigned task"'s on the uno, and what the responses will be from the uno.

Once you have that working, add in the esp, and get it to send those same commands to the uno.....    one step at a time work your way up to your phone....  

 

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There's an echo in here: https://www.avrfreaks.net/commen...

 

frown

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...