balena-os / wifi-connect

Easy WiFi setup for Linux devices from your mobile phone or laptop
Apache License 2.0
1.3k stars 364 forks source link

"wifi-connect: cannot execute binary file" when running from balenaCloud main terminal #259

Open charliesneath opened 5 years ago

charliesneath commented 5 years ago

I have installed wifi-connect via this Dockerfile.template, but when trying to running the following command from the balenaCloud terminal for the container:

./wifi-connect --portal-ssid "NETWORK NAME"

I get the following error:

./wifi-connect: ./wifi-connect: cannot execute binary file.

Any ideas for possible issues here? Goal is to set a custom network name.

majorz commented 5 years ago

Do you see the wifi-connect connect executable in the folder you like to run it from (ls -al)? Is this a RPi device and what version? Can you paste the output of readelf -h /bin/bash.

charliesneath commented 5 years ago

Here's the how I see the file with of ls -al:

-rwxr-xr-x 1 root root 3815476 Nov  5 19:07 wifi-connect

This is a Raspberry Pi Zero W. Here's the output of readelf -h /bin/bash:

  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           ARM
  Version:                           0x1
  Entry point address:               0x2ce78
  Start of program headers:          52 (bytes into file)
  Start of section headers:          911552 (bytes into file)
  Flags:                             0x5000400, Version5 EABI, hard-float ABI
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         9
  Size of section headers:           40 (bytes)
  Number of section headers:         29
  Section header string table index: 28
majorz commented 5 years ago

@charliesneath I made a copy/paste mistake. This is the command which output I need to take a look at: readelf -h ./wifi-connect

charliesneath commented 5 years ago

@majorz Output from readelf -h ./wifi-connect:

ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              DYN (Shared object file)
  Machine:                           ARM
  Version:                           0x1
  Entry point address:               0x1e538
  Start of program headers:          52 (bytes into file)
  Start of section headers:          3814236 (bytes into file)
  Flags:                             0x5000402, Version5 EABI, hard-floatABI, <unknown>
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         10
  Size of section headers:           40 (bytes)
  Number of section headers:         31
  Section header string table index: 30
majorz commented 5 years ago

Did you solve this issue here? What is odd is that wifi-connect is marked as Type: DYN (Shared object file).