Firmware download into ESP8266 with esptool - esp8266

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.

Related

installing DPDK on Ubuntu 18.04 and intel XL710

I'm trying to make DPDK work on my machine without success; My machine is running Ubuntu 18.04 and the NIC I'm trying to bind is an Intel XL710. I'm completely new to DPDK and not an expert on linux.
Additional context: I need DPDK in order to get more bandwidth when using a USRP SDR (Software Defined Radio), that has this capability.
What I've done so far:
Added default_hugepagesz=1G hugepagesz=1G hugepages=8 to the grub config
Cloned and compiled DPDK 19, installed with make install. Result: Installation in /usr/local/ complete
get the status of the devices and drivers using ./dpdk-devbind.py -s. The relevant line I get from this command is: 0000:02:00.0 'Ethernet Controller XL710 for 40GbE QSFP+ 1583' if=enp2s0f0 drv=i40e unused=
When I try to bind the device (even if it is already binded? shouldn't I get a different driver/option for that?) using sudo ./dpdk-devbind.py -b i40e 0000:02:00.0 I get:
Warning: no supported DPDK kernel modules are loaded
Notice: 0000:02:00.0 already bound to driver i40e, skipping
What am I missing?
Thanks in advance for the help.
Before binding the i40e NIC to DPDK PMD driver, you need to load uio or vfio Linux driver as shown below:
modprobe uio
insmod ./x86_64-native-linux-gcc/kmod/igb_uio.ko
or
modprobe vfio-pci
Take a look at link to know why we should load kernel module before ports are bind to DPDK.

How do I install luac.cross on a Mac?

NodeMCU documentation states
NodeMCU firmware build now automatically generates a luac.cross image
as standard in the firmware root directory; this can be used to
compile and to syntax-check Lua source on the Development machine for
execution under NodeMCU Lua on the ESP8266.
Where do I get luac.cross from and how do I install it?
Do I build NodeMCU firmware from source on Mac and is luac.cross created as part of that process? I have been using the cloud service to create custom firmware. Is luac.cross available via cloud build?
Straight lua code has overwhelmed the MakerFocus NodeMCU board resulting runtime panic with out of memory issue. Hoping compiled code will reduce RAM needs.
Where do I get luac.cross from and how do I install it?
You gave the answer in the quote from the documentation you posted. Specifically this
NodeMCU firmware build now automatically generates a luac.cross image...
So, if you build the NodeMCU manually on your platform the build process will also create a lua.cross for your platform. That's the reason you cannot download or install lua.cross - it has to fit your platform i.e. OS et.al.
The logical next question would then be: how do I manually build NodeMCU on macOS?
I don't know the answer to that as I build with the Docker image (from yours truly) on macOS. Running the Docker build creates a luac.cross in the firmware root directory. However, as macOS is just the host OS for Docker in this setup luac.cross is for Linux rather than native for macOS. To use it you would start the Docker container again and run bash in it to get a shell to execute the Lua cross compilation: docker run --rm -ti -vpwd:/opt/nodemcu-firmware marcelstoer/nodemcu-build bash.
Straight lua code has overwhelmed the MakerFocus NodeMCU board resulting runtime panic with out of memory issue. Hoping compiled code will reduce RAM needs.
I hate to disillusion you, but if I had to bet I would expect that savings won't be significant enough to yield the expected results. As you already started reading documentation I'd like to point you to the relevant FAQ: How is NodeMCU Lua different to standard Lua? and Techniques for Reducing RAM
And maybe using LFS will be your life saver.
In case you want to use this tool regardless of the platform - you can use my API to build it:
curl -d #yourscript.lua -X POST https://nodemcu-luacross-run-64l7ehzjta-uc.a.run.app/compile > output.luac

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

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.

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