Third party package from github on AR300M - teensy websockets

I'm super new to this while learning a lot keep getting totally stuck as I find the way the wikis are written very tough to decipher / translate...

I have just got 3 AR300M's which come with a really nice GUI and openwrt installed so thats nice and easy. I can set it up without even having to use the command line :slight_smile: win

but I can't for the life of me figure out how to install a package from github, this one:
https://github.com/nemik/fadecandy-openwrt

I get the following when i run the installer in the GUI - there is only 4mbs of space on the router so it seems I cannot download git too, is this right? is this necessary? am i missing something very simple?!

Unknown package 'src-git'.
Unknown package 'fadecandy'.
Unknown package 'git://github.com/nemik/fadecandy-openwrt.git'.
Collected errors:
 * opkg_install_cmd: Cannot install package src-git.
Collected errors:
 * opkg_install_cmd: Cannot install package fadecandy.
Collected errors:
 * opkg_install_cmd: Cannot install package git://github.com/nemik/fadecandy-openwrt.git.

This is literally the only thing I need to run on the router, configure it on the network and it's good to go.... if only it was that simple!

You need to build that before using it.
https://openwrt.org/docs/guide-developer/build-system/start

1 Like

last commit 2014 -> uclibc dependency..... :frowning:

maybe try find a better / newer source / teency-socket-firmware?

Shit - so not as easy as adding one line and then running a few commands... In way over my head again!

You can add this to your own OpenWRT build by adding the line src-git fadecandy git://github.com/nemik/fadecandy-openwrt.git to your “feeds.conf.default”. Then run ./scripts/feeds update -a , then ./scripts/feeds install -a . Then run make menuconfig . Select “fcserver” from “Utilities” and your target architecture/device. Then run make

Not so bad...

The C++ libraries that it looks like that code needs should be available.

https://openwrt.org/docs/guide-developer/build-system/install-buildsystem

My recent notes (this week) on dependencies for a minimal Debian install are

sudo apt install build-essential git libncurses5-dev gawk unzip wget curl ccache rsync zlib1g-dev

Edit: I removed gitk as that is a personal convenience tool, not something needed to build.

If you're building 18.06, you probably also need

sudo apt install time

If you want NAND support, or the GL.iNet firrmware (the green and gray stuff), their repo can be cloned with (renaming the default location to openwrt-glinet)

git clone https://github.com/gl-inet/glinet openwrt-glinet

it builds "the same" as the OpenWrt repo, which can be cloned with

git clone https://git.openwrt.org/openwrt/openwrt.git

If building off the GL.iNet sources, you'll effectively get 18.06. If you're building off the OpenWrt sources, you have your choice of 18.06 or master. I prefer master myself, especially with a device with "trivial" (browser-based even!) TFTP recovery in the unlikely situation that a specific build is not bootable (can't remember a time when that was the case in since the LEDE split a couple years ago).

Edit:

I'd suggest enabling ccache in the developer options for faster re-builds.

Figure 10-20 minutes for the toolchain build on a fast machine, perhaps an hour on a slower machine.

Once that first build is done, they are a lot faster (~6 minutes for me), especially with ccache enabled.

2 Likes

Thanks Jeff - seems a bit less daunting now.

So basically the process is:

  1. Download the Linux build tools
  2. Download a version of the openwrt firmware I want to my mac
  3. Add the package I want to this
  4. Build or compile (?) this firmware
  5. Then flash it to the router...

Is there an a advantage to using the gi.link firmware if my usage will be mainly just the websocket and a bit of networking? Setting as a client and down the road a mesh.

Reliability, stability and speed of boot (if it goes wrong) are priorities! A gui is nice but not actually nessesary as I learn more, getting pretty comfortable with terminal.

@jeff has helped me to help you... maybe :wink:

it builds! with the current GL source and a few tweaks... here is my notes.....

credits due:

#On Debian Stretch vbox nb:the device i selected may not be the same as yours
#############################################################################
#apt-get install build-essential subversion libncurses5-dev zlib1g-dev gawk gcc-multilib flex git-core gettext libssl-dev
#############################################################################

#############################################################################
#as non-root!
git clone https://github.com/gl-inet/openwrt
cd openwrt


echo "src-git fadecandy git://github.com/nemik/fadecandy-openwrt.git" >> feeds.conf.default
./scripts/feeds update -a
./scripts/feeds install -a


make menuconfig #ar71 > subtarget 300M ##Utilities > scroll way down fcserver
#NB: I selected all GL + Image Builder < this will take long time but you get all ipk
#note: i think you will want the GL stuff and probably a few other things ^ as-per preference
#############################################################################
# i did make here but should fail see below...

#forum.openwrt.org/t/tools-bison-lib-fseterr-c-build-problems-on-18-06-0-due-to-glibc-2-28-changes/18926/2
# ^GLgitCURRENT<patch>BISON>error_fseterr ^
#############################################################################
--- a/build_dir/host/bison-3.0.4/lib/fseterr.c
+++ b/build_dir/host/bison-3.0.4/lib/fseterr.c
@@ -29,7 +29,7 @@ fseterr (FILE *fp)
   /* Most systems provide FILE as a struct and the necessary bitmask in
      <stdio.h>, because they need it for implementing getc() and putc() as
      fast macros.  */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
   fp->_flags |= _IO_ERR_SEEN;
 #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
   fp_->_flags |= __SERR;
#############################################################################

#whoops left this out of patch leave hashes
#neartopofaftercomments-file: build_dir/host/bison-3.0.4/lib/stdio-impl.h

#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
# define _IO_IN_BACKUP 0x100
#endif


make -j12 V=s

#############################################################################
#NB: build fails wpad + wpad-mini selected
make menuconfig #> netowrking > scroll down... down... deselect wpad-mini
make -j12 V=s

find . | grep -i candy | grep ipk
./bin/packages/mips_24kc/fadecandy/fcserver_0.2_mips_24kc.ipk
#Assuming your router model is same and same version

scp ./bin/packages/mips_24kc/fadecandy/fcserver_0.2_mips_24kc.ipk root@routerip:/tmp
ssh root@yourrouterip 'opkg install /tmp/fcserver_0.2_mips_24kc.ipk'

#Otherwise you have to flash from here
vert@nuc23:/xrc/wrt/_x-ipq/GL-15or17-1-ar71x-GL.iNet_GLAR300M/openwrt$ ls bin/targets/ar71xx/generic/
config.seed
openwrt-ar71xx-generic-device-gl-ar300m.manifest
openwrt-ar71xx-generic-gl-ar300m-squashfs-sysupgrade.bin
openwrt-imagebuilder-ar71xx-generic.Linux-x86_64.tar.xz
packages

Also, GL.iNet.....very impressed first time i've seen what they do/have... well done guys!

1 Like

The one thing I would add to your list and wulfy's helpful notes is that the build system is pretty dicey on FreeBSD and I don't know that it has been shaken out on macOS at all. I'd recommend a VM running Debian (my current choice of Linux distros for interactive use). VirtualBox works well. As I recall you need at least 32 GB of disk, if not 64 GB. "Expandable" works fine for the disk. Setting up two interfaces, one for NAT and one for "host only" means that you'll be able to SSH in to your VM once the initial install/config is done. (You might have to configure "vboxnet0" in VirtualBox to get the host-only option.) If you can spare them, at least 4 cores will speed things. 1-2 GB of memory should be enough.

You can skip the graphical environment if you include sshd as one of the services in the install. I'd also install sudo (and make sure that your non-privileged user is in the right group, usermod -G sudo <you> is, as I recall, the proper incantation.

Other than installing the packages with apt, nothing should be run as root when building OpenWrt!

If you're 100% comfortable with working on the command line then the master branch of OpenWrt would probably be fine.

If you want LuCI (what's behind the "Advanced Settings" in the GL.iNet menu and what you often see posted here), then I'd add luci-ssl-nginx from the LuCI > Collections screen in make menuconfig.

The GL.iNet firmware includes many solid "travel router" features that I find valuable and its merge-base of v18.06.1 is relatively recent. I run GL.iNet firmware on the AR750S that is with me on travel.

If you have an AR300M with NAND flash, only the GL.iNet firmware supports the NAND. Running master would limit you to the 16 MB of NOR flash, which it probably sufficient. (I'm working on SPI NAND support on the other AR750S that is with me, but won't happen until after v19 is released.)

If building on master, you should use the better-maintained ath79 target (ar71xx is being deprecated). If you have an AR300M-Lite, there is a different target for that than the AR300M. The major difference is that as the -Lite has only a single Ethernet, it needs to be configured as LAN on first boot so that you can access the device (as well as in failsafe).

I personally add to most of my builds (on either source tree) that would possibly be useful to you

CONFIG_DEVEL=y
CONFIG_BUILD_LOG=y
CONFIG_CCACHE=y

CONFIG_PACKAGE_block-mount=y

CONFIG_PACKAGE_diffutils=y

CONFIG_PACKAGE_findutils-find=y

CONFIG_PACKAGE_htop=y

CONFIG_PACKAGE_kmod-fs-ext4=y

CONFIG_PACKAGE_kmod-usb-storage=y
CONFIG_PACKAGE_kmod-usb-storage-uas=y

CONFIG_PACKAGE_less=y

CONFIG_PACKAGE_procps-ng=y

CONFIG_PACKAGE_tcpdump-mini=y

CONFIG_PACKAGE_usbutils=y

# CONFIG_PACKAGE_wpad-basic is not set
CONFIG_PACKAGE_wpad-mesh-openssl=y

In make menuconfig, the slash / key lets you search. For common terms, something like GE_less can focus the results more.