NodeMCU firmware does not run after downloading firmware - nodemcu

I am trying to download the NodeMCU firmware, but after downloading
rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
Falling back to built-in command interpreter.
OK
The NodeMCU documentation,Flashing the firmware, this describes the general command format. The command I used was:
sudo espressif/esptool/repo/esptool.py --port /dev/ttyS8 write_flash -fm dio 0x00000 nodemcu/repo/bin/0x00000.bin
Note, I am running this within Windows WSL Debian based distro hence ttyS8.
My assumption why this doesn't work is due to the message seen within the console. After a bit of searching I did find some information within the letscontrolit/ESPEasy forum, found here by voducng. His response was the following:
You need to flash the bootloader. So under Windows10/cmd:
I do erase: flasherase.cmd:
esptool.exe --chip esp32 --port COM11 --baud 256000 --before default_reset --after hard_reset erase_flash
I do use flash the boot loader: flashbootloader.cmd:
esptool.exe --chip esp32 --port COM11 --baud 256000 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0x8000 partitions2.bin 0xe000 boot_app0.bin 0x1000 bootloader.bin
and flashfirmware.cmd:
esptool.exe --chip esp32 --port COM11 --baud 256000 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0x10000 firmware.bin
I am able to issue commands 1 and 3, but I can't execute command #2 since I don't know where the file partitions2.bin is. There are a couple of bootloader files I found in the esptool repo, but not sure which one to use.
Here is the listing after searching for these files
user#machine:/mnt/c/MyFiles/Projects/espressif$ find . -iname *partition*.bin
./esp-idf/components/nvs_flash/test/partition_encrypted.bin
./esp-idf/components/wear_levelling/test/test_partition_v1.bin
./esptool/repo/test/images/partitions_singleapp.bin
user#machine:/mnt/c/MyFiles/Projects/espressif$ find . -iname *boot*.bin
./esptool/repo/test/images/bootloader_esp32.bin
./esptool/repo/test/images/bootloader_esp32s2beta.bin
./esptool/repo/test/images/esp8266_sdk/boot_v1.4(b1).bin
./esptool/repo/test/secure_images/bootloader-encrypted-conf0.bin
./esptool/repo/test/secure_images/bootloader-encrypted-conf3.bin
./esptool/repo/test/secure_images/bootloader-encrypted-conf9.bin
./esptool/repo/test/secure_images/bootloader-encrypted-confc.bin
./esptool/repo/test/secure_images/bootloader-encrypted.bin
./esptool/repo/test/secure_images/bootloader.bin
./esptool/repo/test/secure_images/bootloader_digested.bin
./esptool/repo/test/secure_images/bootloader_signed.bin
Anyone see what I am doing wrong?

Related

Limit on number of wireless "sta" stations in openwrt

I have openwrt implementation on a TPLink WR902AC (pocket router)
I have a /etc/network/wireless configuration file with 10 sta configurations for connecting to AP all of which are active (option disabled '0')
This is to ensure that openwrt connects to any one of the APs configured.
Only the first 4 configured are attempted to be connected and the rest are simply ignored.
(if first 4 configured are not available the 5th one is being ignored)
I tried to identify the bottleneck.
Only first 4 wpa_supplicant instances are called as evident from these files in /tmp/run
./tmp/run/wpa_supplicant/wifi3
./tmp/run/wpa_supplicant/wifi1
./tmp/run/wpa_supplicant/wifi2
./tmp/run/wpa_supplicant/wifi0
When I disable the first one, the fifth one gets connected on reconnect with "wifi"
I tried to check the source code. I lost the track after ubus being called from wifi script.
This I believe is similar question to https://forum.openwrt.org/t/limit-on-the-number-of-wifi-ssids/63141
iw list on openwrt show me the limit.
valid interface combinations:
* #{ IBSS } <= 1, #{ managed, AP, mesh point, P2P-client, P2P-GO } <= 4,
total <= 4, #channels <= 1, STA/AP BI must match
I tried to use wpa_supplicant directly instead of depending on scripts.
wpa_supplicant -c /root/wifi0.conf -i wifi0 -s -B
wpa_supplicant -c /root/wifi1.conf -i wifi1 -s -B
wpa_supplicant -c /root/wifi2.conf -i wifi2 -s -B
wpa_supplicant -c /root/wifi3.conf -i wifi3 -s -B
wpa_supplicant -c /root/wifi4.conf -i wifi4 -s -B
wpa_supplicant -c /root/wifi5.conf -i wifi5 -s -B
This failed with "interface wifi4" not available error.
Could someone point me to the source where this hard limit is set?
Is there any way around this?
Thanks in advance.
Update:-
mt7601u based usb WiFi dongle was added to wr902ac and configured (as radio2)
This time only one is connected. If I have AP configured, sta doesn't even get connected.
so number of slots is limited. (ap counts as one slot and each sta is one slot)
The built-in 2.4 GHZ has 4 slots & 5 GHz has 8 slots.
The mt7601u based wifi has only 1 slot.
Probably there exists a usb dongle that has 8 slots. Could someone point me to the theory behind all this?

Yocto- bitbake qt5-image - trouble creating bootable flash for rpi from result

I have been researching online for a proper way to create a bootable SD card (through USB adapter) for my raspberry pi from files created by "bitbake qt5-image" command. The build process finished successfully with no warnings or errors. Resulting files that I assume are relevant to my goal are:
in ~/rpi/build/tmp/deploy/images/raspberrypi:
` "modules-raspberrypi.tgz" link to
modules-1-4.14.73+git0+e117f3e9fd-r0-raspberrypi-20181009142103.tgz 17.mb
"qt5-image-raspberrypi.tar.xz" link to
qt5-image-raspberrypi-20181009142103.rootfs.tar.xz 92.8 mb
"zImage" link to
zImage-1-4.14.73+git0+e117f3e9fd-r0-raspberrypi-20181009142103.bin 4.7mb
I also took some advice from this tutorial (https://jumpnowtek.com/rpi/Raspberry-Pi-Systems-with-Yocto.html) for steps before the build.
Any advice on the matter would be greatly appreciated!
Edit (I changed KERNEL_IMAGETYPE to = "Image" in build/conf/local.conf from zimage) which produced this
Content (excluding btbo files) of tmp/deploy/images/raspberrypi/
bcm2708-rpi-0-w.dtb
bcm2708-rpi-b.dtb
bcm2708-rpi-b-plus.dtb
bcm2708-rpi-cm.dtb
bcm2709-rpi-2-b.dtb
bcm2710-rpi-3-b.dtb
bcm2710-rpi-3-b-plus.dtb
bcm2710-rpi-cm3.dtb
bcm2835-bootfiles
**Image Link to Image-1-4.14.73+git0+e117f3e9fd-r0-raspberrypi-20181010131555.bin**
Image-1-4.14.73+git0+e117f3e9fd-r0-bcm2708-rpi-0-w-20181010131555.dtb
Image-1-4.14.73+git0+e117f3e9fd-r0-bcm2708-rpi-b-20181010131555.dtb
Image-1-4.14.73+git0+e117f3e9fd-r0-bcm2708-rpi-b-plus-20181010131555.dtb
Image-1-4.14.73+git0+e117f3e9fd-r0-bcm2708-rpi-cm-20181010131555.dtb
Image-1-4.14.73+git0+e117f3e9fd-r0-bcm2709-rpi-2-b-20181010131555.dtb
Image-1-4.14.73+git0+e117f3e9fd-r0-bcm2710-rpi-3-b-20181010131555.dtb
Image-1-4.14.73+git0+e117f3e9fd-r0-bcm2710-rpi-3-b-plus-20181010131555.dtb
Image-1-4.14.73+git0+e117f3e9fd-r0-bcm2710-rpi-cm3-20181010131555.dtb
Image-bcm2708-rpi-0-w.dtb
Image-bcm2708-rpi-b.dtb
Image-bcm2708-rpi-b-plus.dtb
Image-bcm2708-rpi-cm.dtb
Image-bcm2709-rpi-2-b.dtb
Image-bcm2710-rpi-3-b.dtb
Image-bcm2710-rpi-3-b-plus.dtb
Image-bcm2710-rpi-cm3.dtb
modules-1-4.14.73+git0+e117f3e9fd-r0-raspberrypi-20181010131555.tgz
modules-raspberrypi.tgz
qt5-image-raspberrypi-20181009142103.testdata.json
qt5-image-raspberrypi-20181010131555.rootfs.manifest
qt5-image-raspberrypi-20181010131555.rootfs.tar.xz
qt5-image-raspberrypi-20181010131555.testdata.json
qt5-image-raspberrypi.manifest
qt5-image-raspberrypi.tar.xz
qt5-image-raspberrypi.testdata.json
Content of build/conf/bblayers.conf
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf /bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
${HOME}/poky/meta \
${HOME}/poky/meta-poky \
${HOME}/poky/meta-openembedded/meta-oe \
${HOME}/poky/meta-openembedded/meta-multimedia \
${HOME}/poky/meta-openembedded/meta-networking \
${HOME}/poky/meta-openembedded/meta-perl \
${HOME}/poky/meta-openembedded/meta-python \
${HOME}/poky/meta-qt5 \
${HOME}/poky/meta-raspberrypi \
${HOME}/poky/meta-security \
${HOME}/rpi/meta-rpi \
"
If you are using latest meta-raspberrypi layer as machine layer, then you will be getting WIC image as output in tmp/deploy/images/raspberrypi.
This image can be directly flashed into SD card as it already partitioned as,
# short-description: Create Raspberry Pi SD card image
# long-description: Creates a partitioned SD card image for use with
# Raspberry Pi. Boot files are located in the first vfat partition.
part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4096 --size 20
part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4096
So you don't need to manually partition the SD card and copy the respective files.

Vanilla kernel build on Rasperry Pi 1 B+

Attempting to build mainline vanilla kernel (4.9) and boot on a Raspberry Pi 1 B+. Have followed instructions here. Currently boot hangs with the following output
Net: No ethernet found. starting USB...
USB0: Core Release: 2.80a
scanning bus 0 for devices... 3 USB Device(s) found
scanning usb for storage devices... 0 Starage Device(s) found
Hit any key to stap autoboot: 0
switch to partition #0, OK
mmc0 is current device
Scanning mmc 0:1
Found U-Boot script /boot.scr.uimg
reading /boot.scr.uimg 326 bytes read in 25 ms (12.7KiB/s)
## Exectuting script at 02000000 switch to partitions #0, OK
mmc0 is current device
reading ZImage
4064616 bytes read in 389 Ms (10MiB/s)
reading bcm2835-rpi-b-plus.dtb
7101 bytes read in 31 Ms (223.6KiB/s)
Kernel image # 0x1000000 [ 0x000000 _0x3e0568 ]
## Flattened Device Tree blob at 00000100
Booting using the fdt blob at 0x000100
Using Device Tree in place at 00000100, end 00004cbc
Starting kernel ...
boot.scr.uimg was built using mkimage from Ubuntu repositories
$ mkimage -V
mkimage version 2016.01+dfsg1-2ubuntu3
$ mkimage -A arm -O linux -T script -C none -n boot.scr -d boot.scr boot.scr.uimg
boot.scr is as listed in the instructions.
mmc dev 0
setenv fdtfile bcm2835-rpi-b-plus.dtb
setenv bootargs earlyprintk console=tty0 console=ttyAMA0 root=/dev/mmcblk0p2 rootwait
fatload mmc 0:1 ${kernel_addr_r} zImage
fatload mmc 0:1 ${fdt_addr_r} ${fdtfile}
bootz ${kernel_addr_r} - ${fdt_addr_r}

How to insert hwmon module (ARM)

I fear that this is a very specific question.
Hardware: Gumstix Overo Fire (ARM Cortex A8)
Distro: Poky (customized with the Yocto Project)
Kernel: 3.5.7
I tried to write a program to read a HIH6130 i2c sensor, using /dev/i2c-3 and < linux/i2c-dev.h>, but despite it works for every other i2c device, it does not work for this one. Probably this happens because a particularity of the reading protocol, but anyway, that's not the topic.
I found this code that implements a driver for that sensor, and it is inside a so called "hwmon", which seems to be a collection of sensor drivers.
After successfully compiled and inserted this module I was expecting to see the entry humidity1_input somewhere under hwmon but I didn't find it.
root#overo:/sys# find -name hum*
root#overo:/sys# find -name hih*
./bus/i2c/drivers/hih6130
./module/hih6130
root#overo:/sys# ls ./bus/i2c/drivers/hih6130
bind module uevent unbind
root#overo:/sys# ls ./module/hih6130
coresize holders initstate refcnt srcversion uevent
drivers initsize notes sections taint
Do I have to do something else to enable the reading of this sensor? Any ideas?
I ended up using i2cget to read it:
$ i2cget -y 3 0x27 0x00
Later, the author, Iain Paton, kindly showed me how to bind the driver:
$ insmod hih6130.ko
$ echo hih6130 0x27 > /sys/bus/i2c/devices/i2c-3/new_device
In my device it appeared in this directory:
$ find /sys/ -name humidity*
/sys/devices/platform/omap_i2c.3/i2c-3/3-0027/humidity1_input
Also there is a 'temp1_input' in this same directory.

Gumstix Overo wifi drops continously

I am using Gumstix overo and from the past many days I am unable to get my Wifi working correctly.
I followed the instructions from Gumstix Overo Wifi and Overo Wifi to set correct parameters in /etc/network/interfaces and /etc/wpa_supplicant.conf.
/etc/network/interfaces file:
# Wireless interfaces
auto wlan0
iface wlan0 inet dhcp
pre-up wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B
down killall -q wpa_supplicant
wpa_supplicant.conf:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1
eapol_version=1
ap_scan=1
fast_reauth=1
network={
ssid="xxxxxx"
proto=WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
scan_ssid=1
psk="xxxxx"
priority=10
}
After setting up and running ifdown wlan0 && ifup wlan0 i constantly get this message:
[ 1176.528778] cfg80211: Calling CRDA to update world regulatory domain
[ 2155.687255] cfg80211: Calling CRDA to update world regulatory domain
[ 1175.293609] cfg80211: Calling CRDA to update world regulatory domain
My iwconfig:
lo no wireless extensions.
wlan0 IEEE 802.11bg ESSID:off/any
Mode:Managed Frequency:2.412 GHz Access Point: Not-Associated
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:on
My lsmod looks like this:
root#overo:~# lsmod
Module Size Used by
libertas_sdio 16484 0
libertas 99993 1 libertas_sdio
firmware_class 6920 2 libertas_sdio,libertas
ipv6 252525 22
cfg80211 172644 1 libertas
rfkill 17524 3 cfg80211
lib80211 5138 1 libertas
mt9v032 7169 1
omap3_isp 132270 0
v4l2_common 8681 2 omap3_isp,mt9v032
ads7846 10528 0
videodev 98880 3 omap3_isp,mt9v032,v4l2_common
media 12853 3 omap3_isp,mt9v032,videodev
I am using yocto project for gumstix cloned from https://github.com/gumstix/Gumstix-YoctoProject-Repo
It would be great help if I could get any inputs where I am doing wrong.
The reason for wifi drop is the Network manager. By disabling it we can run ifconfig, iwconfig without any interference from the NetworkManager.
or Another workaround is this which is quite successful:
After creating SD card with proper Image on, do not unmount the partitions.
Install a Custom systemd Service
To bring up the wireless interface on boot, you will need to create and install a custom systemd service on the microSD card.
In the rootfs partition, create a new service script:
$sudoedit /media/rootfs/etc/systemd/system/network-wireless#.service
Copy and paste the following into the file:
Description=Wireless network connectivity (%i)
Wants=network.target
Before=network.target
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/ifconfig %i up
ExecStart=/usr/sbin/wpa_supplicant -B -i %i -c /etc/wpa_supplicant.conf
ExecStart=/sbin/dhclient %i
RestartSec=1min
Restart=on-failure
ExecStop=/sbin/ifconfig %i down
[Install]
WantedBy=multi-user.target
Save this file.
Because we are editing these files on a development machine, the normal systemd method of enabling services (systemctl) will not work. To enable our new service:
~ Change into the multi-user.target.wants directory on the root filesystem:
$cd /media/rootfs/etc/systemd/system/multi-user.target.wants/
~ Create a symbolic link to enable the service:
Overo Series COMs
$sudo ln -s ../network-wireless#.service network-wireless#wlan0.service
Finally, edit the wpa_supplicant configuration file:
$sudoedit /media/rootfs/etc/wpa_supplicant.conf
Change it to look like the following:
network={
ssid="Your Network's SSID"
psk="Your WPA2 Passkey"
}
Save the file.
Unmount the partitions on the microSD card.
SSH Into Your System
1) If you don't know the ip $ssh root#overo.local
2) If you know the IP address $ssh root#192.xx.xx.xx.local

Resources