- (optional) Backup flash
esptool.py --port port-of-esp8266 --baud 115200 read_flash 0x000 4194304 fw_backup.bin
- Erase flash
esptool.py --port port-of-esp8266 --baud 115200 erase_flash
- Write esp init data (see SDK Init Data)
esptool.py --port port-of-esp8266 --baud 115200 write_flash 0x3fc000 esp_init_data_default.bin
- Write firmware
esptool.py --port port-of-esp8266 --baud 115200 write_flash 0x0000 fw.bin
Posts mit dem Label osx werden angezeigt. Alle Posts anzeigen
Posts mit dem Label osx werden angezeigt. Alle Posts anzeigen
2016-12-29
Flash ESP8266-12/12E
Labels:
Electronic,
esp8266,
osx
Steps to flash new firmware:
2016-04-07
First Steps with ESP-01 on OS X El Capitan - Part 2
Labels:
Electronic,
esp8266,
make,
maker,
osx
In part 1 I described how I setup my my environment. In this part I will show my first lua programming steps with the ESP8266 using the Lua based NodeMCU firmware.
First I create an init script (init.lua). This will be loaded by the firmware after each boot/restart.
As last step in the boot/restart process the firmware loads and executes the script init.lua (you can see a corresponding error message in the last screenshot in part 1).
It is recommended to provide an opportunity to interrupt the execution of init.lua to be able to change anything. Otherwise it may happen e.g. if your code contains a fatal error which cause a reboot that you are unable to deactivate/fix the code - and finally have to reflash the firmware to be break the loop.
I'm looking around an found a post about Methods of Interrupting init.lua during boot. My init.lua code based mainly on the ideas described there. But here it is:
Next step was to wrote a script to read out a DHT22 sensor. The user_dht22.lua script shown below reads temperature and humidity every 2 sec and prints both values. Depending on the used firmware the output is generated using different format and in case of integer also further values.
Output running the script
First I create an init script (init.lua). This will be loaded by the firmware after each boot/restart.
As last step in the boot/restart process the firmware loads and executes the script init.lua (you can see a corresponding error message in the last screenshot in part 1).
It is recommended to provide an opportunity to interrupt the execution of init.lua to be able to change anything. Otherwise it may happen e.g. if your code contains a fatal error which cause a reboot that you are unable to deactivate/fix the code - and finally have to reflash the firmware to be break the loop.
I'm looking around an found a post about Methods of Interrupting init.lua during boot. My init.lua code based mainly on the ideas described there. But here it is:
- it calls
firmwareInfo()
to output information about the firmware. For the moment it just inform if it is a FLOAT or INTEGER version - after a delay of
BootTimeout
ms (to give the NodeMCU some time to initialize it self)init()
is called - in
init()
the serial port is initialized and configured to watch for a transmitted ENTER key - if an ENTER is received the function
abort()
is called, which set theabortFlag
to true. - After
AbortTimeout
msstartup()
is called. There theabortFlag
is checked and the startup is canceled or executed by trying to load and execute 'user.lua'
Next step was to wrote a script to read out a DHT22 sensor. The user_dht22.lua script shown below reads temperature and humidity every 2 sec and prints both values. Depending on the used firmware the output is generated using different format and in case of integer also further values.
Output running the script
2016-03-29
First Steps with ESP-01 on OS X El Capitan
Labels:
Electronic,
esp8266,
make,
maker,
osx
Environment: MacBook Pro Mid 2010, OS X El Capitan 10.11.4
ESP-01 Module + Simple DIY Dev Board (based on this)
ESP-01 Module + Simple DIY Dev Board (based on this)
- Install
esptool
to backup/change/update ESP8266 firmware - Clone git repository
https://github.com/themadinventor/esptool
$ git clone https://github.com/themadinventor/esptool.git Cloning into 'esptool'... ...
cd esptool
- run install routine
$ sudo python setup.py install Password: running install ... Installing esptool.py script to /usr/local/bin
- Connect ESP8266 ESP-01 Board via CH340G Converter to MBP
- Install CH340G driver (WCH provides a signed driver)
- Identify the tty port
$ ls /dev/tty.w* /dev/tty.wchusbserial410
- activate ESP boot loader (needs to be repeat before each esptool command) by reset ESP and pull GPIO 0 to GND meanwhile.
- Check communication
$ esptool.py --port /dev/tty.wchusbserial410 --baud 115200 flash_id Connecting... Manufacturer: c8 Device: 4013 $ esptool.py --port /dev/tty.wchusbserial410 --baud 115200 chip_id Connecting... Chip ID: 0x009b82bc
- (optional) make a backup of the original firmware - takes about 48sec
$ time esptool.py --port /dev/tty.wchusbserial410 --baud 115200 read_flash 0x000 524288 fw_backup.bin Connecting... Please wait... real 0m47.721s user 0m0.762s sys 0m0.344s
(Note: ESP12-E has a bigger flash - 4MB = 4194304) - Flash alternative firmware - I want to give NodeMCU firmware a try
- Use standard NodeMCU firmware (download from github) or
- Config your own customized NodeMCU firmware
- Get the download links (integer and float version) about 2min later (you can also use the preconfigured
- Flash it to the ESP-01 (I start with the integer version)
$ time esptool.py --port /dev/tty.wchusbserial410 --baud 115200 write_flash 0x00000 nodemcu-master-9-modules-2016-03-29-19-22-38-integer.bin Connecting... Erasing flash... Took 1.22s to erase flash block Wrote 403456 bytes at 0x00000000 in 48.2 seconds (66.9 kbit/s)... Leaving... real 0m50.195s user 0m0.383s sys 0m0.126s
- Connect to ESP. I use SerialTools (AppStore Link) - Note: Baud Rate is 76800
2014-03-30
Arduino 1.5 does not start on Java 7
After updating to OSX 10.9.2 Mavericks and also update to Java 7 64 bit the Arduino app does not start any longer.
When I try to start it the icon flash up in the dock but nothing else happens. Further on no useful messages appears in log - just:
To solve the problem I have to reinstall Java 1.6. An forum post in the Microchip forum give some further information about the installation.
$ java -version java version "1.7.0_45" Java(TM) SE Runtime Environment (build 1.7.0_45-b18) Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
When I try to start it the icon flash up in the dock but nothing else happens. Further on no useful messages appears in log - just:
30.03.14 12:36:48,231 com.apple.launchd.peruser.501[279]: (cc.arduino.Arduino.86448[1902]) Exited with code: 1
To solve the problem I have to reinstall Java 1.6. An forum post in the Microchip forum give some further information about the installation.
2012-03-10
HP Laserjet 2100 mit Jetdirect 600n J3111A an OS X Lion
Kurzes Protokoll über den Anschluss des Laserjets:
- Nachrüsten des Jetdirect Moduls im HP 2100 - einfach einstecken fertig
- Konfiguration ermitteln - gleichzeitig beide Tasten am Drucker drücken -> Drucker Selbsttest/Konfiguration + JetDirect-Konfigurationsseite
- per Telnet die Einstellungen anpassen
- Firmware Update G.07.20 auf G.08.20
- geht leider nur mit dem HP Download Manager unter Windows
- beim ersten Versuch blieb der Progress Balken bei ca. 10% stehen, ein Abbruch ist bei einem Firmware Update immer kritisch, daher hab ich erstmal ca. 30min gewartet, ob es nicht doch noch weiter geht. Dann Drucker aus, Programm beendet
- Nachdem ich Windows Notebook und Drucker direkt an einen Switch angeschlossen habe (vorher war der Notebook per WLAN verbunden) hat es dann funktioniert (Dauer: ca. 5min)
- Drucker einrichten
- Generic PCL Laser Printer
- Unter Optionen -> Treiber Drucken mit "Allgemeiner PCL-Drucker" auswählen
2012-03-02
Microsoft Natural Keyboard am Mac
Nach dem Umstieg auf einen iMac wollte ich an diesem mein MS Natural Keyboard betreiben. Grundsätzlich funktionieren die Standardtasten ab Werk - einfach USB Stecker rein und fertig. Um aber die Zusatztasten oder gar die Tastenbelegung wie aufgedruckt zu benutzen sind weitere Schritte notwendig.
- Treiber von Microsoft installieren (Link)
- In der Systemeinstellung befinden sich danach weitere Icons.
- In den Microsoft Tastatur Einstellungen unter Optionen den Tastaturtyp auf ISO (Europa) stellen.
- Unter Systemeinstellung - Sprache & Text - Eingabequellen zusätzlich Deutsch - Mircosoft auswählen und die Eingabequellen in der Menuzeile anzeigen auswählen.
- Schließlich in der Menuzeile Deutsch - Microsoft als Tastaturlayout auswählen.
Danach funktionieren (fast) alle Tasten wie aufgedruckt.
2012-02-12
AVRISPV2 / STK500v2 und Arduino 1.0 unter OSX
Labels:
Electronic,
make,
maker,
osx
Seit kurzem habe ich einen STK500v2 Clone von Sure Electronic (bei ebay beworben als: "Mini ATMEL AVR ATMEGA STK500 USB Programmer ISP AVRISP").
Um den Programmer mit Arduino 1.0 unter OSX betreiben zu können, waren folgende Anpassungen nötig:
Um den Programmer mit Arduino 1.0 unter OSX betreiben zu können, waren folgende Anpassungen nötig:
- Treiber installieren
Auf der Webseite von Sure Electronics kann man zwar auch ein Treiberpaket downloaden, der enthaltene Treiber hat aber ein Datum von 2006. Ich habe daher diesen Treiber installiert.
- Den Programmer in Arduino bekannt machen
Dazu habe ich in der Datei programmer.txt (Bestandteil von Arduino) die folgenden Zeilen eintragen:
- Anschliessend konnte ich dann in Arduino sowohl den Programmer als auch das zugehörige serielle Interface auswählen.
2011-02-19
USB4all unter OSX 10.6
Labels:
Electronic,
make,
maker,
osx
USB4all stellt ein USB Interface für die Ansteuerung von Hardware bereit.
Im Download-Paket auf der Seite befindet u.a. sich ein Archiv mit Beispielen zur Ansteuerung von USB4all unter Linux (usb4all-linux-v103.tgz). Um die Beispiele auf OSX zu übersetzen, benötigt man die MacPorts libusb und libusb-compat. Diese installiert man mit:
Im Download-Paket auf der Seite befindet u.a. sich ein Archiv mit Beispielen zur Ansteuerung von USB4all unter Linux (usb4all-linux-v103.tgz). Um die Beispiele auf OSX zu übersetzen, benötigt man die MacPorts libusb und libusb-compat. Diese installiert man mit:
sudo port install libusb libusb-compatIn den Beispielen muss dann in den Makefiles die Variable LIB um die Pfade zu usb.h und libusb ergänzt werden (-I und -L Parameter):
LIB="-I/opt/local/include -L/opt/local/lib -lusb"
Abonnieren
Posts (Atom)