www.robowars.org

RoboWars Australia Forum Index -> General Chatter

ESP8266
Goto page Previous  1, 2, 3, 4, 5  Next

Post new topic   Reply to topic
  Author    Thread
marto
Experienced Roboteer


Joined: 08 Jul 2004
Posts: 5443
Location: Brisbane, QLD


 Reply with quote  

To flash it you just run

make flash

Cute com is for sending AT commands. Good to hear it worked.

Steve
_________________
Steven Martin
Twisted Constructions
http://www.botbitz.com

Post Tue Jan 27, 2015 7:07 am 
 View user's profile Send private message Send e-mail MSN Messenger
Tim



Joined: 30 Oct 2013
Posts: 247
Location: QLD


 Reply with quote  

Hi guys,

When I type

code:
make flash



this is returned

code:
john@john-K55VJ:~/Espressif/source-code-examples/blinky$ make flash
esptool.py --port /dev/ttyUSB0 write_flash 0x00000 firmware/0x00000.bin 0x40000 firmware/0x40000.bin
Traceback (most recent call last):
  File "/home/john/Espressif/crosstool-NG/builds/xtensa-lx106-elf/bin/esptool.py", line 407, in <module>
    esp = ESPROM(args.port, args.baud)
  File "/home/john/Espressif/crosstool-NG/builds/xtensa-lx106-elf/bin/esptool.py", line 60, in __init__
    self._port = serial.Serial(port, baud)
  File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 261, in __init__
    self.open()
  File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 278, in open
    raise SerialException("could not open port %s: %s" % (self._port, msg))
serial.serialutil.SerialException: could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'
make: [flash] Error 1 (ignored)
john@john-K55VJ:~/Espressif/source-code-examples/blinky$






I assumed /dev/ttyUSB0 was the serial adaptor I'm using a http://www.freetronics.com.au/collections/all-products/products/usb-serial-adapter#.VMiAzGOli1E however google tells me dev/ttyUSB0 is a directory, that as above states doesn't exist.

Looking for the device I ran
code:
john@john-K55VJ:~$ find /sys/bus/usb/devices/usb*/ -name dev
/sys/bus/usb/devices/usb1/1-1/dev
/sys/bus/usb/devices/usb1/1-1/1-1.3/dev
/sys/bus/usb/devices/usb1/1-1/1-1.3/1-1.3:1.0/input/input12/event5/dev
/sys/bus/usb/devices/usb1/1-1/1-1.3/1-1.3:1.0/video4linux/video0/dev
/sys/bus/usb/devices/usb1/dev
/sys/bus/usb/devices/usb2/2-1/dev
/sys/bus/usb/devices/usb2/dev
/sys/bus/usb/devices/usb3/dev
/sys/bus/usb/devices/usb4/dev
john@john-K55VJ:~$ find /sys/bus/usb/devices/usb*/ -name dev
/sys/bus/usb/devices/usb1/1-1/dev
/sys/bus/usb/devices/usb1/1-1/1-1.3/dev
/sys/bus/usb/devices/usb1/1-1/1-1.3/1-1.3:1.0/input/input12/event5/dev
/sys/bus/usb/devices/usb1/1-1/1-1.3/1-1.3:1.0/video4linux/video0/dev
/sys/bus/usb/devices/usb1/dev
/sys/bus/usb/devices/usb2/2-1/dev
/sys/bus/usb/devices/usb2/dev
/sys/bus/usb/devices/usb3/3-2/dev
/sys/bus/usb/devices/usb3/3-2/3-2:1.0/tty/ttyACM0/dev
/sys/bus/usb/devices/usb3/dev
/sys/bus/usb/devices/usb4/dev




The first time with the device unplugged then plugging it back in and running the command again. It seems
code:
/sys/bus/usb/devices/usb3/3-2/3-2:1.0/tty/ttyACM0/dev


is the USB Serial Adaptor I would like to be able to use, I had added myself "john" in this case to the Dialout group as per the tutorial a few days ago,

Here is a snipet from the blinky Makefile
code:
# tnx to mamalala
# Changelog
# Changed the variables to include the header file directory
# Added global var for the XTENSA tool root
#
# This make file still needs some work.
#
#
# Output directors to store intermediate compiled files
# relative to the project directory
BUILD_BASE   = build
FW_BASE      = firmware

# Base directory for the compiler
XTENSA_TOOLS_ROOT ?= /home/john/Espressif/crosstool-NG/builds/xtensa-lx106-elf/bin
# base directory of the ESP8266 SDK package, absolute
SDK_BASE   ?= /home/john/Espressif/ESP8266_SDK

#Esptool.py path and port
ESPTOOL      ?= esptool.py
ESPPORT      ?= /dev/ttyUSB0

# name for the target project
TARGET      = app




I modified the first two /opt files as described I take it I need to point the Makefile at my device, under #Esptool.py path and port this is, how it sits currently
code:
ESPPORT      ?= /dev/ttyUSB0

I have a feeling that it should it be changed to ( as below)

code:
ESPPORT      ?=1.0/tty/ttyACM0/dev

which is what I believe the usb serial adaptor appears as, if anyone has any thoughts/ideas on the matter it would be much appreciated.

Cheers Tim Very Happy

Post Wed Jan 28, 2015 5:24 pm 
 View user's profile Send private message
marto
Experienced Roboteer


Joined: 08 Jul 2004
Posts: 5443
Location: Brisbane, QLD


 Reply with quote  

it should be /dev/ttyACM0

Steve
_________________
Steven Martin
Twisted Constructions
http://www.botbitz.com

Post Wed Jan 28, 2015 5:43 pm 
 View user's profile Send private message Send e-mail MSN Messenger
Tim



Joined: 30 Oct 2013
Posts: 247
Location: QLD


 Reply with quote  

Thanks Steve that worked! now it's attempting to connect but failing, I am using all the same wiring I used to flash 3 chips with via windows last night, using the lubuntu vm sdk v0.9.2 with the correct pin defs for the job.

code:
john@john-K55VJ:~/Espressif/source-code-examples/blinky$ make flash
esptool.py --port /dev/ttyACM0  write_flash 0x00000 firmware/0x00000.bin 0x40000 firmware/0x40000.bin
Connecting...
Traceback (most recent call last):
  File "/home/john/Espressif/crosstool-NG/builds/xtensa-lx106-elf/bin/esptool.py", line 408, in <module>
    esp.connect()
  File "/home/john/Espressif/crosstool-NG/builds/xtensa-lx106-elf/bin/esptool.py", line 143, in connect
    raise Exception('Failed to connect')
Exception: Failed to connect
make: [flash] Error 1 (ignored)




line 408 in the esptool.py txt is
code:
esp.connect()



and line 143 in the esptool.py txt is
code:
raise Exception('Failed to connect')



Sounds like my wirings bad potentially (but it worked last night?), or should I extend the time out duration in the gedit file just to give it a chance? Does this mean anything to you? Sorry for the vague question.

Cheers Tim

Post Wed Jan 28, 2015 6:45 pm 
 View user's profile Send private message
marto
Experienced Roboteer


Joined: 08 Jul 2004
Posts: 5443
Location: Brisbane, QLD


 Reply with quote  

Hmmm if it works in the VM or windows then its not the wiring maybe do a reboot just to confirm in that.

The other option is that you make not have permission to connect using that port, could try sudo in front of the command and run it as root.

your port could also have changed from /dev/ttyACM0 run

ls /dev/tty*

to list all the ports and look for ttyACM? or ttyUSB? to see if it has changed

Steve
_________________
Steven Martin
Twisted Constructions
http://www.botbitz.com

Post Wed Jan 28, 2015 7:14 pm 
 View user's profile Send private message Send e-mail MSN Messenger
Tim



Joined: 30 Oct 2013
Posts: 247
Location: QLD


 Reply with quote  

/dev/ttyACM0 is still there will reboot see what happens

Post Wed Jan 28, 2015 7:22 pm 
 View user's profile Send private message
Tim



Joined: 30 Oct 2013
Posts: 247
Location: QLD


 Reply with quote  

Rebooted no change, Looking in the Makefile, there is the below code.

code:
# which modules (subdirectories) of the project to include in compiling
MODULES      = driver user
EXTRA_INCDIR    = include /opt/Espressif/include




Looking in the Computer there is no... (not one I can find anyway.)

/opt/Espressif/include "folder"

but there is a

/opt/Espressif/crostool-NG

/crostool-NG being the only folder in the /opt/Espressif/ directory


Does this need editing as per the other two /opt/ entries?

Otherwise power is a solid 3.3volts, however I am not currently using a separate Logic level converter.

Cheers Tim

edit:- /dev/ttyACM0 is still /dev/ttyACM0 after i remove and insert device even after reboot.

Post Wed Jan 28, 2015 8:54 pm 
 View user's profile Send private message
Tim



Joined: 30 Oct 2013
Posts: 247
Location: QLD


 Reply with quote  

Ok things I learnt so far -

Using a jaycar 13.8volt 12A power supply and a LM317 voltage reg I was able to get consistent 3.3 volt, however the esp8266 gets really hot and I *think has a thermal cutout so that may have played a part in failed flashes. I derived this theory when I switched off the power to chip that had got quite hot and plugged in a fresh one and powered up again the first attempt the bins flashed.

In the Makefile i had to do a third edit to -

code:
  /opt/Espressif/include


and changed it to

code:
include /home/john/Espressif/crosstool-NG




@Steve thanks for all your help and input cheers man, you have made a number of *nix commands tools easier to understand and use.

I'll put up the schematic for the power supply circuit I used if anyone is interested it's just a LM317 adjustable volttage reg / A10K Pot / some random resistor??? /

logic-level-converter-
http://www.freetronics.com.au/collections/all-products/products/logic-level-converter-module#.VMkLZmOli1E

usb-serial-adapter
http://www.freetronics.com.au/collections/all-products/products/usb-serial-
adapter#.VMkLjmOli1E

The biggest thing is to get a really stable power supply going as these things can use up to 250-300ma @ 3.3v

Amongst the spaghetti there is a blinking LED YAY!!! Very Happy
https://www.youtube.com/watch?v=FUZdLst36p0

Cheers Tim Very Happy

Post Thu Jan 29, 2015 2:45 am 
 View user's profile Send private message
marto
Experienced Roboteer


Joined: 08 Jul 2004
Posts: 5443
Location: Brisbane, QLD


 Reply with quote  


quote:
Check you can build stuff.

cd ~/Espressif
git clone https://github.com/esp8266/source-code-examples.git
cd source-code-examples/blinky

You will need to change all the references to /opt to /home/<your username> in the makefile

gedit Makefile

Replace the two entries of /opt then you should be good to go


See this is why you don't deviate from the tutorial Razz

Great to hear you got it working. There is some interesting libraries out there for it so you can do plenty of cool stuff and I have been imressed with just the amount of storage you can fit on it.

My ESP8266 stopped getting hot once I unplugged on of the pins which I had shorted to ground.

I haven't bothered with a logic level converter they should be relatively tolerant of 5V as long as thats only used for programming. I am using a USB to TLL serial cable I found in my bin and a 3.3V linear reg off an arduino and seems to be working fine.

Steve

Steve[/code]
_________________
Steven Martin
Twisted Constructions
http://www.botbitz.com

Post Thu Jan 29, 2015 7:08 am 
 View user's profile Send private message Send e-mail MSN Messenger
Tim



Joined: 30 Oct 2013
Posts: 247
Location: QLD


 Reply with quote  

Cheers for your time and help, having a dedicated *nix machine for building with the gcc is a big help. Yet to do anything else with the esp to date, as it ate up a lot of time, looking to order some other bits and pieces/basic projects and get further acquainted with this SoC ie. make something useful that works

Cheers Tim

Post Thu Feb 19, 2015 3:41 am 
 View user's profile Send private message
marto
Experienced Roboteer


Joined: 08 Jul 2004
Posts: 5443
Location: Brisbane, QLD


 Reply with quote  

Got a new unit after using the other one for things.

Made up an adapter board for easy programming. 3hrs later still can't get the damn thing to work. Maybe I will have better luck tonight.

Steve
_________________
Steven Martin
Twisted Constructions
http://www.botbitz.com

Post Sat Mar 21, 2015 9:04 am 
 View user's profile Send private message Send e-mail MSN Messenger
Tim



Joined: 30 Oct 2013
Posts: 247
Location: QLD


 Reply with quote  

Damn, all those hours can work in your favor when it comes to trouble shooting though at least that's how I see it, two of the six I ordered were doa spent hours if not days trying to get them going only to plug another in and have it work. Did you get a later version of the chip or the ESP8266EX with on board antenna? I've noticed different versions need specific firmware versions to work but that s just what I've read.

Post Sat Mar 21, 2015 1:46 pm 
 View user's profile Send private message
Valen
Experienced Roboteer


Joined: 07 Jul 2004
Posts: 4425
Location: Sydney


 Reply with quote  

I'm going to get some of these things, where is a reputable place to acquire said items?
_________________
Mechanical engineers build weapons, civil engineers build targets

Post Sat Mar 21, 2015 9:45 pm 
 View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
marto
Experienced Roboteer


Joined: 08 Jul 2004
Posts: 5443
Location: Brisbane, QLD


 Reply with quote  

Lol I don't think so.
_________________
Steven Martin
Twisted Constructions
http://www.botbitz.com

Post Sat Mar 21, 2015 10:00 pm 
 View user's profile Send private message Send e-mail MSN Messenger
Knightrous
Site Admin


Joined: 15 Jun 2004
Posts: 8469
Location: NSW


 Reply with quote  

https://www.kickstarter.com/projects/digistump/oak-by-digistump-wi-fi-for-all-things-arduino-comp
_________________
RoboWars Sydney 2013 Sportsman Champion - Farmboy

Post Mon Apr 27, 2015 8:09 am 
 View user's profile Send private message Visit poster's website
  Display posts from previous:      

Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 4 of 5

Goto page Previous  1, 2, 3, 4, 5  Next

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Last Thread | Next Thread  >
Powered by phpBB: © 2001 phpBB Group
millenniumFalcon Template By Vereor.