dragino / dragino-packages

23 stars 27 forks source link

lora_pkt_fwd #8

Open iot-floriani opened 3 years ago

iot-floriani commented 3 years ago

Hi,

would like to modify the lora_pkg_fwd firmware, but even if I download all the files, I cannot compile it, due to errors and lack of libraries.

Somebody can share all the necessary files with me?

Thank you

Qqwy commented 3 years ago

I managed to download and build the project on an old VPS which still is running Ubuntu 14.04. On my current 'normal' machine, the version of ncurses is already so much newer that the menuconfig-program does not even start up :man_shrugging: .

You might be able to reproduce it by e.g. running version 14.04 of Ubuntu in a virtual machine or container.

The steps I followed were these:

  1. Download and extract Dragino's OpenWRT SDK fork. Make it your current directory in the shell.
  2. Run ./scripts/feeds update -a (This is missing from Dragino's the current readme about building your own package!)
  3. Copy the files in this folder over to ./package/lg02-pkt-fwd.
  4. Be sure to remove all current *.o object files which are in the ./package/lg02-pkt-fwd directory! If you don't, you will get very confusing linker errors. (This is also missing from the current readme) Even make clean will not correctly remove them (and instead might remove other files that the build process depends on, which are not remade when running a normal make, so then you'll have to restart from step (1.) ...)
  5. Run make menuconfig, and be sure that the package is selected under 'Utilities'. Save this config and exit.
  6. Make any changes to the source code you wish, by modifying the files at ./package/lg02-pkt-fwd/....
  7. Run make. If there's errors, you can see them in detail by running make -j1 V=s instead.
  8. If compilation was successful, the built package can now be found under ./bin/packages/mips_24kc/base/. It is named something like lg02_pkt_fwd_1.2.1-1_mips_24kc.ipk.
  9. Copy it over to your Dragino LG02, using e.g. scp (for instance: scp -P 2222 ./lg02_pkt_fwd_1.2.1-1_mips_24kc.ipk root@dragino_ip_address:/tmp/ .
  10. On the Dragino run opkg remove lg02_pkt_fwd followed by opkg install /tmp/lg02_pkt_fwd_1.2.1-1_mips_24kc.ipk (or what the exact filename may be).

For clarity: I wanted to make changes to the code of the Dragino LG02's lg02_pkt_fwd code. I expect that for one of the other packages the process will be similar, but you might need to make some further changes.

Qqwy commented 3 years ago

I've tested it in a docker container based on Ubuntu 14.04. Besides 'raw' ubuntu, you'll need to install:

and then you'll be able to build it successfully. :slightly_smiling_face: