I can't get a python prompt on ESP8266/nodemcu with micropython - esp8266

I've flashed several different versions of micropython onto my ESP8266/nodemcu board and I keep getting the following output in a terminal:
rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x01,hd_drv:0x00,wp_drv:0x04
mode:QIO, clock div:2
cmd len 2
ets_main.c 371
ets Jun 8 2016 00:22:57
These messages repeat continuously. I've tried both with and without -fm dio and -fm qio. When I hit the flash button, it indicates on the terminal it's ready for download at which time I run the esptool.py to flash the micropython.

Are You trying it on Windows, Mac or Linux?
I've recently had some problems with the NodeMcu and Micrpython as well and therefore set up a pretty easy to read and straightforward documentation python2nodemcu on GitHub (what I would call an end-to-end documentation).
Please have a look at it and then verify the following (short version of the link above):
Do You have Python3 installed?
Run python --version
Or python3 --version
Do You have the proper driver installed for serial USB-to-UART connection?
See here
Do You know the device file name, which represents the interface of Your device?
Give it a try with ls -la /dev/tty.*
Do You have the most recent MicroPython firmware?
You also need the correct one for the NodeMcu
I guess, EspTool and PySerial are installed properly?
Can You delete the flash without an error?
Try python3 esptool.py --port /dev/tty.{device-file} erase_flash
Does the most simple flashing command (without parameters) work?
Try python3 esptool.py --port /dev/tty.{device-file} write_flash 0x00000 {latest-micropython-firmware-for-node-mcu}.bin
Did You try to connect to the REPL prompt?
Try screen /dev/tty.{device-file} 115200
Maybe try different baud rates, depending on Your driver, cable, etc.
Did You try to connect to the board using Ampy?
E.g., You can list the files on Your device using python3 ampy/cli.py --port /dev/tty.{device-file} --baud 115200 ls
Again, maybe try other baud rates
Next to this, can You:
Flash the board with the default firmware?
Connect to it with some 3rd party software, such as EspLorer or CoolTherm?
As of my experience, You do not necessarily need to push the physical flash button on the device. Just run the erase_flash and then the flash command as stated above.

Related

Using printers on Yocto

Some days ago I decided to us Yocto for running my custom photo booth application on a Raspberry Pi. Main reason why choosing Yocto was the lack of a recent QT version on Raspbian which was needed by some features. Other solution didn't offer a hardware acceleration.
After getting the most features running, I stopped at the problem getting the printer configured and running. Cups seems to be sane and running corrently.
My goal was, that the printer is set up at first login by a profile.d-script. I'm using the lpadmin command:
# Check to see if the printer is already installed
if [ `lpstat -p 2>&1 | grep -E 'CP910' -c || true` = "0" ]
then
echo "Installing CP910"
lpadmin -p CP910 -E -m /usr/share/cups/ppd/Canon_CP910.ppd -v usb://Canon/CP910?serial=C91xxxxxxx
lpadmin -d CP910
cupsenable
fi
I copied the PPD file from my Ubuntu computer. lpadmin issues no error. lpstat -v lists my added printer. The output of lpstat -v looks on both Ubuntu and Yocto the same.
When trying to print any file, the state stays at "sending data" and nothing happens.
I have seen that there are cups-filters and drivers. I haven't found any recipes for filters and drivers for Yocto. So I assume that everything is shipped with the CUPS recipt?
Besides CUPS also Gutenprint is needed. Gutenprint provides the printer drivers. Without Gutenprint, CUPS can not connect to the printer.
Yocto currently has no recipe for Gutenprint. Maybe you are lucky and someone will write a recipe soon.
The CP910 can print via Wifi. Fortunately, there is a program that can start printing jobs via Wifi: https://github.com/saeugetier/go-selphy-cp

Firmware download into ESP8266 with esptool

I am using ESP8266 Arduino with SPIFFS to store configuration settings.
This command is used for flashing the binary firmware.bin into ESP8266 for Arduino.
esptool.exe -cd nodemcu -cb 115200 -cp COM3 -ca 0x00000 -cf firmware.bin
This command is used for flashing the binary firmware.nin into ESP8266 using the SMING framework.
esptool.exe -p COM3 -b 115200 write_flash -ff 40m -fm dio -fs 4m 0x00000 0x00000.bin 0x09000 0x09000.bin 0x44000 spiff_rom.bin
There are some puzzling aspects in the command used for Arduino flash download.
Why isn't there a separate bin file for SPIFFS for Arduino? I noticed the tool "mkspiffs.exe" in esp8266\tools\mkspiffs folder is not used during compilation of the bin file. Why is it not used?
How does Arduino esptool know which address to use for allocating to SPIFFS file system address?
I would like to understand the process of programming binary file as I encountered strange behavior with SPIFFS with ESP8266 Arduino. I have no problem with similar firmware using SMING framework. I am wondering if the problem is caused by how the firmware is being flashed into ESP8266 using esptool.
I am using Eclise Arduino IDE. When you create a new project, you get to specify -how big is the code area and SPIFFS area. For example, for NodeMCU board which is using 4MB flash, I choose 1MB code/3MB SPIFFS. This is how arduino esptool knows the starting address of SPIFFS.
In SMING, the starting address of SPIFFS is manually specified.

Run a local script on an SSH machine

I would like to run a script on a device that I have established an SSH session into. However, the script is on my local Windows machine.
For my experiment, I have:
A python script on my local machine (Windows)
A jailbroken iOS device that I can SSH into using putty
I want to run the python script, that's located on my windows machine, on my jailbroken device.
Is this possible?
I know on a Mac, you can actually use the terminal to do just that and it would look something like this.
python [pythonfile].py [parameters] [target device]
The reason why I can't just run the python script on my device is because I can't install python on that device (at least it isn't on Cydia). Plus, I don't want to pay for an app that executes it.
Let me know if you have any suggestions, thanks.
Have you tried this libssh2-for-iOS. Its an open source library which does exactly the same thing you are looking for.

How to make WiFi work for toshiba C850...?

I have a toshiba laptop c850, dual core. Toshiba does not provide any driver for Wi-Fi for Ubuntu 12.10. I am currently having problem in using DSL modem, Ethernet and Wi-Fi. Can anyone tell me the solution to this problem?
maybe you will find some information there :
http://www.linlap.com/toshiba_satellite_c850-c855
Wireless
A really up to date kernel is required for wireless support, at least
3.5.0 is recommended. Realtek has the Linux drivers available for download but they must be re-complied after upgrades to kernel.
As you commented, you got the Atheros Communications Inc. AR8162 Fast Ethernet Controller.
This is some guesswork here because there are several versions of the driver and some people state only one is working for them, I stick with the most popular for now.
First download this file from another machine:
https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5-u.tar.bz2
If you have Ubuntu or another Linux distro on your second machine you can use wget to download the file:
wget https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5-u.tar.bz2
Next, use your preferred method (preferably an USB Drive) to copy it to your target machine (Toshiba C850) and use the following commands in a terminal. Make sure you are in the right directory first and use cd to change to the directory where your downloaded file resides.
tar -xzvf compat-drivers-2013-03-28-5-u.tar.bz2
cd compat-drivers-2013-03-28-5-u
./scripts/driver-select alx
make
sudo make install
sudo modprobe alx
If this doesn't work try a reboot first then you can try one of the other versions, I can't tell which will work for you:
http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-2012-02-28-p.tar.bz2
https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/04/compat-drivers-2013-03-04-u.tar.bz2
Sources (for further reading): This question on AskUbuntu and this thread in the Ubuntu forums.

debug bridge for iPhone / shell command prompt

For Android there is ADB (Android debug bridge) which allows to get a shell on the connected device:
adb shell
Is there something similar for iOS?
I'd like to type some shell commands on my Mac that would be executed on the connected iPhone.
Is there a built-in Terminal on iPhone?
There isn't anything for it built in, but if you are jailbroken or can sideload apps (a.k.a., you have a mac with XCode), you can run a local terminal with apps like MobileTerminal, which aren't available on the app store.
To access a shell from a computer, if you are jailbroken (and possibly even if you aren't, if you can sideload apps) you can install openssh or openssh-server from Cydia (I believe it is just called "OpenSSH" in the GUI). Once that is running on your device, you can connect the device over USB and use this shell script I made called idb to access a shell, push and pull files, and so on. This sets up a USB link to relay TCP packets from the SSH server on the device, and then 'wraps' around SSH and SCP to perform the required tasks.
You'll have to compile a program to make it work called iproxy; this program relays TCP over the USB bus to allow ssh over a cable. The comments in the script I wrote explain how to do this (sorry... I plan to move it into README.md eventually).
The program follows most of the syntax of adb and implements some of the more commonly used operations of it.
Without jailbreaking, your options are more limited, but it may be possible to do something. I haven't tried since I don't regularly use iOS anymore.
use ssh through network (e.g. Wi-Fi), and iphone/ipad need download and enable ssh service, firstly.

Resources