Gateway on Raspberry Pi Zero W

Hi,

We are currently having issues getting raspberry pi 3 boards (out of stock - difficult to find) and thought of changing the gateway to Raspberry Pi zero W. Unfortunately the current image provided does not boot on raspberry pi zero W.

We understand that you do not provide the source codes for the dwm1001 daemons. Is it possible to get an image that can be successfully booted on raspberry Pi zero W?

regards,
Mewantha

Hi @mewanthak
itā€™s a interesting idea. From my point of view (I didnā€™t tested it, I donā€™t have a RPI zero) it might be a doable with some minimal image. There is no ETH interface that will corrupt the timing but the Wi-Fi might be able to do it.

As you have mentioned the current image does not work with RPi zero but maybe if you successfully boot some image you can just copy & paste files from RPi regular image. The biggest issue will be the kernel module which is built against some kernel version try to copy /lib/modules/4.14.50-v7+/dwm.ko to RPi zero and then run ā€œdepmod -aā€, " echo dwm >> /etc/modules" reboot the system and then check if the module is loaded or not (lsmod). Dont forgot to enable the SPI interface first via ā€œsudo raspi-configā€ otherwise the module will be not loaded anyway.

Cheers
JK

1 Like

Did you ever figure this out? The shortage of Piā€™s is only getting worse.

1 Like

Hi @asmi242
nope, I dint tested it.

Cheers
JK

Hi JK,

I finally got around to trying this. The Pi Zero booted with the image Iā€™ve been using successfully on a Pi 3B+. It looks like the gateway application is being served correctly over the Apache, but there are no messages being forwarded to the MQTT. This leads me to believe the DWM Daemon (or maybe the kernel) isnā€™t working correctly. Could you suggest some troubleshooting steps I could try?

Hi @asmi242
did you check the lsmod if you can see there the dwm module?

Cheers
JK

Yes, it looks like the dwm module is not running. The module is in /lib/modules/4.14.50-v7+/dwm.ko and listed in the /etc/modules-load config file.
lsmod and dmesg output below:

pi@raspberrypizone:~ $ lsmod
Module Size Used by
fuse 92214 3
rfcomm 37969 6
cmac 3230 1
bnep 11981 2
hci_uart 26546 1
btbcm 8248 1 hci_uart
serdev 9370 1 hci_uart
bluetooth 366847 29 hci_uart,bnep,btbcm,rfcomm
ecdh_generic 17649 1 bluetooth
spidev 7220 0
brcmfmac 273198 0
brcmutil 9114 1 brcmfmac
cfg80211 542242 1 brcmfmac
rfkill 21476 6 bluetooth,cfg80211
snd_bcm2835 22991 1
snd_pcm 89590 1 snd_bcm2835
snd_timer 22396 1 snd_pcm
i2c_bcm2835 6465 0
snd 60154 5 snd_timer,snd_bcm2835,snd_pcm
spi_bcm2835 7456 0
fixed 3033 0
uio_pdrv_genirq 3718 0
uio 9901 1 uio_pdrv_genirq
i2c_dev 6674 0
ip_tables 12427 0
x_tables 22098 1 ip_tables
ipv6 401778 37
pi@raspberrypizone:~ $ dmesg
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.14.50+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1122 Tue Jun 19 12:21:21 BST 2018
[ 0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Raspberry Pi Zero W Rev 1.1
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] cma: Reserved 8 MiB at 0x1b400000
[ 0.000000] On node 0 totalpages: 114688
[ 0.000000] free_area_init_node: node 0, pgdat c09c04f8, node_mem_map db010000
[ 0.000000] Normal zone: 1008 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 114688 pages, LIFO batch:31
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 113680
[ 0.000000] Kernel command line: 8250.nr_uarts=1 bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:9A:15:07 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 console=tty1 console=ttyS0,115200 root=PARTUUID=c049f471-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 435256K/458752K available (6421K kernel code, 587K rwdata, 1988K rodata, 440K init, 677K bss, 15304K reserved, 8192K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xdc800000 - 0xff800000 ( 560 MB)
lowmem : 0xc0000000 - 0xdc000000 ( 448 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc064d94c (6423 kB)
.init : 0xc08ca000 - 0xc0938000 ( 440 kB)
.data : 0xc0938000 - 0xc09cae90 ( 588 kB)
.bss : 0xc09d07d0 - 0xc0a79d24 ( 678 kB)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] ftrace: allocating 24091 entries in 71 pages
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000029] sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 2147483647500ns
[ 0.000060] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275 ns
[ 0.000145] bcm2835: system timer (irq = 27)
[ 0.000699] Console: colour dummy device 80x30
[ 0.000725] console [tty1] enabled
[ 0.000767] Calibrating delay loopā€¦ 697.95 BogoMIPS (lpj=3489792)
[ 0.060290] pid_max: default: 32768 minimum: 301
[ 0.060786] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.060806] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.062077] Disabling memory control group subsystem
[ 0.062243] CPU: Testing write buffer coherency: ok
[ 0.063329] Setting up static identity map for 0x8200 - 0x8238
[ 0.064570] devtmpfs: initialized
[ 0.073540] random: get_random_u32 called from bucket_table_alloc+0x88/0x1c4 with crng_init=0
[ 0.074510] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
[ 0.074879] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.074908] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.076222] pinctrl core: initialized pinctrl subsystem
[ 0.077543] NET: Registered protocol family 16
[ 0.080613] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[ 0.087115] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
[ 0.087132] hw-breakpoint: maximum watchpoint size is 4 bytes.
[ 0.087257] Serial: AMBA PL011 UART driver
[ 0.089998] bcm2835-mbox 2000b880.mailbox: mailbox enabled
[ 0.090799] uart-pl011 20201000.serial: could not find pctldev for node /soc/gpio@7e200000/uart0_pins, deferring probe
[ 0.131299] bcm2835-dma 20007000.dma: DMA legacy API manager at dc80d000, dmachans=0x1
[ 0.133504] SCSI subsystem initialized
[ 0.133728] usbcore: registered new interface driver usbfs
[ 0.133819] usbcore: registered new interface driver hub
[ 0.134019] usbcore: registered new device driver usb
[ 0.140788] raspberrypi-firmware soc:firmware: Attached to firmware from 2018-06-07 15:31
[ 0.142899] clocksource: Switched to clocksource timer
[ 0.229710] VFS: Disk quotas dquot_6.6.0
[ 0.229832] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.230123] FS-Cache: Loaded
[ 0.230436] CacheFiles: Loaded
[ 0.247475] NET: Registered protocol family 2
[ 0.248636] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.248723] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.248818] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.248970] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.248999] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.249345] NET: Registered protocol family 1
[ 0.250057] RPC: Registered named UNIX socket transport module.
[ 0.250068] RPC: Registered udp transport module.
[ 0.250073] RPC: Registered tcp transport module.
[ 0.250078] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.252084] hw perfevents: no irqs for PMU, sampling events not supported
[ 0.252153] hw perfevents: enabled with armv6_1176 PMU driver, 3 counters available
[ 0.255938] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[ 0.268072] FS-Cache: Netfs ā€˜nfsā€™ registered for caching
[ 0.269392] NFS: Registering the id_resolver key type
[ 0.269440] Key type id_resolver registered
[ 0.269448] Key type id_legacy registered
[ 0.269474] nfs4filelayout_init: NFSv4 File Layout Driver Registeringā€¦
[ 0.274204] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[ 0.274614] io scheduler noop registered
[ 0.274627] io scheduler deadline registered (default)
[ 0.275161] io scheduler cfq registered
[ 0.275177] io scheduler mq-deadline registered
[ 0.275184] io scheduler kyber registered
[ 0.277476] BCM2708FB: allocated DMA memory 5b500000
[ 0.277539] BCM2708FB: allocated DMA channel 0 @ dc80d000
[ 0.328723] Console: switching to colour frame buffer device 240x67
[ 0.369808] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[ 0.372855] bcm2835-rng 20104000.rng: hwrng registered
[ 0.373306] vc-mem: phys_addr:0x00000000 mem_base=0x1ec00000 mem_size:0x20000000(512 MiB)
[ 0.374499] vc-sm: Videocore shared memory driver
[ 0.375194] gpiomem-bcm2835 20200000.gpiomem: Initialised: Registers at 0x20200000
[ 0.396726] brd: module loaded
[ 0.410420] loop: module loaded
[ 0.410446] Loading iSCSI transport class v2.0-870.
[ 0.411434] usbcore: registered new interface driver smsc95xx
[ 0.411469] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[ 0.640034] Core Release: 2.80a
[ 0.640056] Setting default values for core params
[ 0.640103] Finished setting default values for core params
[ 0.840515] Using Buffer DMA mode
[ 0.840531] Periodic Transfer Interrupt Enhancement - disabled
[ 0.840537] Multiprocessor Interrupt Enhancement - disabled
[ 0.840549] OTG VER PARAM: 0, OTG VER FLAG: 0
[ 0.840665] Dedicated Tx FIFOs mode
[ 0.841666] WARN::dwc_otg_hcd_init:1046: FIQ DMA bounce buffers: virt = 0xdb514000 dma = 0x5b514000 len=9024
[ 0.841701] FIQ FSM acceleration enabled for :
Non-periodic Split Transactions
Periodic Split Transactions
High-Speed Isochronous Endpoints
Interrupt/Control Split Transaction hack enabled
[ 0.841715] dwc_otg: Microframe scheduler enabled
[ 0.841915] WARN::hcd_init_fiq:459: FIQ on core 0 at 0xc049a168
[ 0.841931] WARN::hcd_init_fiq:460: FIQ ASM at 0xc049a444 length 36
[ 0.841962] WARN::hcd_init_fiq:486: MPHI regs_base at 0xdc8a5000
[ 0.842060] dwc_otg 20980000.usb: DWC OTG Controller
[ 0.842135] dwc_otg 20980000.usb: new USB bus registered, assigned bus number 1
[ 0.842221] dwc_otg 20980000.usb: irq 56, io mem 0x00000000
[ 0.842282] Init: Port Power? op_state=1
[ 0.842288] Init: Power Port (0)
[ 0.842761] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 0.842783] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.842795] usb usb1: Product: DWC OTG Controller
[ 0.842804] usb usb1: Manufacturer: Linux 4.14.50+ dwc_otg_hcd
[ 0.842816] usb usb1: SerialNumber: 20980000.usb
[ 0.844197] hub 1-0:1.0: USB hub found
[ 0.844306] hub 1-0:1.0: 1 port detected
[ 0.845396] dwc_otg: FIQ enabled
[ 0.845408] dwc_otg: NAK holdoff enabled
[ 0.845417] dwc_otg: FIQ split-transaction FSM enabled
[ 0.845436] Module dwc_common_port init
[ 0.845998] usbcore: registered new interface driver usb-storage
[ 0.846464] mousedev: PS/2 mouse device common for all mice
[ 0.846533] IR NEC protocol handler initialized
[ 0.846543] IR RC5(x/sz) protocol handler initialized
[ 0.846548] IR RC6 protocol handler initialized
[ 0.846552] IR JVC protocol handler initialized
[ 0.846559] IR Sony protocol handler initialized
[ 0.846564] IR SANYO protocol handler initialized
[ 0.846569] IR Sharp protocol handler initialized
[ 0.846575] IR MCE Keyboard/mouse protocol handler initialized
[ 0.846580] IR XMP protocol handler initialized
[ 0.848060] bcm2835-wdt 20100000.watchdog: Broadcom BCM2835 watchdog timer
[ 0.848672] bcm2835-cpufreq: min=700000 max=1000000
[ 0.849379] sdhci: Secure Digital Host Controller Interface driver
[ 0.849389] sdhci: Copyright(c) Pierre Ossman
[ 0.849980] mmc-bcm2835 20300000.mmc: could not get clk, deferring probe
[ 0.850667] sdhost-bcm2835 20202000.mmc: could not get clk, deferring probe
[ 0.850886] sdhci-pltfm: SDHCI platform and OF driver helper
[ 0.851525] ledtrig-cpu: registered to indicate activity on CPUs
[ 0.851673] hidraw: raw HID events driver (C) Jiri Kosina
[ 0.851968] usbcore: registered new interface driver usbhid
[ 0.851976] usbhid: USB HID core driver
[ 0.853152] vchiq: vchiq_init_state: slot_zero = db580000, is_master = 0
[ 0.855426] [vc_sm_connected_init]: start
[ 0.866453] [vc_sm_connected_init]: end - returning 0
[ 0.867536] Initializing XFRM netlink socket
[ 0.867603] NET: Registered protocol family 17
[ 0.867794] Key type dns_resolver registered
[ 0.869867] registered taskstats version 1
[ 0.879028] uart-pl011 20201000.serial: cts_event_workaround enabled
[ 0.879202] 20201000.serial: ttyAMA0 at MMIO 0x20201000 (irq = 81, base_baud = 0) is a PL011 rev2
[ 0.882119] console [ttyS0] disabled
[ 0.882189] 20215040.serial: ttyS0 at MMIO 0x0 (irq = 160, base_baud = 31250000) is a 16550
[ 0.882292] console [ttyS0] enabled
[ 0.884173] mmc-bcm2835 20300000.mmc: mmc_debug:0 mmc_debug2:0
[ 0.884193] mmc-bcm2835 20300000.mmc: DMA channel allocated
[ 0.944658] sdhost: log_buf @ db513000 (5b513000)
[ 0.981278] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[ 0.983048] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 0.984737] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 0.987730] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[ 1.013910] random: fast init done
[ 1.022978] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[ 1.024425] of_cfs_init
[ 1.024577] of_cfs_init: OK
[ 1.025907] Waiting for root device PARTUUID=c049f471-02ā€¦
[ 1.100992] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.103004] mmc0: Problem switching card into high-speed mode!
[ 1.103675] mmc0: new SDHC card at address 0001
[ 1.104712] mmcblk0: mmc0:0001 USD00 14.7 GiB
[ 1.107837] mmcblk0: p1 p2
[ 1.123304] mmc1: new high speed SDIO card at address 0001
[ 1.133804] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 1.133954] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[ 1.150831] devtmpfs: mounted
[ 1.153701] Freeing unused kernel memory: 440K
[ 1.153710] This architecture does not have kernel memory protection.
[ 3.204654] systemd[1]: System time before build time, advancing clock.
[ 4.006262] NET: Registered protocol family 10
[ 4.008556] Segment Routing with IPv6
[ 4.044251] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 4.113901] random: systemd: uninitialized urandom read (16 bytes read)
[ 4.125285] systemd[1]: systemd 232 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
[ 4.126482] systemd[1]: Detected architecture arm.
[ 4.128775] systemd[1]: Set hostname to .
[ 4.288197] random: systemd: uninitialized urandom read (16 bytes read)
[ 4.538341] random: systemd-cryptse: uninitialized urandom read (16 bytes read)
[ 5.182858] urandom_read: 4 callbacks suppressed
[ 5.182872] random: systemd: uninitialized urandom read (16 bytes read)
[ 5.183429] random: systemd: uninitialized urandom read (16 bytes read)
[ 5.185749] random: systemd: uninitialized urandom read (16 bytes read)
[ 6.611248] systemd[1]: Listening on Journal Socket (/dev/log).
[ 6.612640] systemd[1]: Reached target Swap.
[ 6.613909] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[ 6.614993] systemd[1]: Listening on udev Control Socket.
[ 6.617190] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[ 6.618070] systemd[1]: Listening on udev Kernel Socket.
[ 6.711817] systemd[1]: Listening on Journal Socket.
[ 7.577173] i2c /dev entries driver
[ 9.833474] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 10.515448] systemd-journald[60]: Received request to flush runtime journal from PID 1
[ 13.896563] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[ 13.964556] bcm2835_alsa bcm2835_alsa: card created with 8 channels
[ 15.163359] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[ 15.206293] brcmfmac: brcmf_fw_map_chip_to_name: using brcm/brcmfmac43430-sdio.bin for chip 0x00a9a6(43430) rev 0x000001
[ 15.206745] usbcore: registered new interface driver brcmfmac
[ 15.730159] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Oct 23 2017 03:55:53 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f
[ 15.731461] brcmfmac: brcmf_c_preinit_dcmds: CLM version = API: 12.2 Data: 7.11.15 Compiler: 1.24.2 ClmImport: 1.24.1 Creation: 2014-05-26 10:53:55 Inc Data: 9.10.39 Inc Compiler: 1.29.4 Inc ClmImport: 1.36.3 Creation: 2017-10-23 03:47:14
[ 21.226777] uart-pl011 20201000.serial: no DMA platform data
[ 24.501206] Adding 102396k swap on /var/swap. Priority:-2 extents:1 across:102396k SSFS
[ 26.094574] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 26.094601] brcmfmac: power management disabled
[ 26.565153] random: crng init done
[ 27.003155] Bluetooth: Core ver 2.22
[ 27.003366] NET: Registered protocol family 31
[ 27.003376] Bluetooth: HCI device and connection manager initialized
[ 27.003410] Bluetooth: HCI socket layer initialized
[ 27.003427] Bluetooth: L2CAP socket layer initialized
[ 27.003480] Bluetooth: SCO socket layer initialized
[ 27.064746] Bluetooth: HCI UART driver ver 2.3
[ 27.064767] Bluetooth: HCI UART protocol H4 registered
[ 27.064775] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 27.084336] Bluetooth: HCI UART protocol Broadcom registered
[ 28.272237] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 28.464728] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 28.464747] Bluetooth: BNEP filters: protocol multicast
[ 28.464779] Bluetooth: BNEP socket layer initialized
[ 29.368891] Bluetooth: RFCOMM TTY layer initialized
[ 29.368937] Bluetooth: RFCOMM socket layer initialized
[ 29.368986] Bluetooth: RFCOMM ver 1.11
[ 49.763117] fuse init (API version 7.26)

Hi @asmi242
this is expected problem - the kernel module is not compatible with the RPI Zero. This is what I have mentioned before that it might not work.

Cheers
JK