[lime] How to test limeapp development versions

Delete this message

Reply to this message
Autor: Selan Kon
Data:  
Dla: LibreMesh.org project mailing list
Temat: [lime] How to test limeapp development versions
This is pretend to be an step by step guide to test the limeapp, in
order to collect information for potential betatesters, and to update
documentation on the repository itself on a near future.

### Heads Up!

If you are testing a development version of the limeapp you may need to
update the lime packages to a specific version!!


# Use Github actions generated artifacts

If a PR contains the label `artifacts` a github action will run to build
the app and publish the artifacts url on a comment on the PR itself.

After download this artifacts you should send it to the router you want
to test as shown below.

# Build lime app by your own

Actually is a very simple process that can be achieved easily, this
guide have to much text because I explain also some concepts. But, a
resume if you don't want to read it all will be:

```
git clone https://github.com/libremesh/lime-app.git limeapp
cd limeapp
# Move to specific branch or whatever
nvm use v16.20.0 # Set specific node version
yarn
NODE_HOST=<ROUTER_IP> yarn dev
```

And done :P


## TLDR the guide:

Lime app is just a Preact app that relies on NodeJs. I personally use
`yarn` instead of `npm` but should work with both.

1. Clone the repository and checkout to the branch/PR you want to test,
on this example we are going to test the PR 388:

```
git clone https://github.com/libremesh/lime-app.git limeapp
cd limeapp
git fetch origin pull/388/head:test-implement-new-landing
git checkout test-implement-new-landing
```

2. Set up the correct node version. For some reason, for node version
above 16 the limeapp crashes. This is an annoying issue and this step
will be removed once fixed, for the moment we have to switch to node 16.

So to ensure we are using the node 16 version I recommend to use
[NVM](https://github.com/nvm-sh/nvm) (node version manager). Once
installed following its instructions:

```
nvm use v16.20.0
```

3. Install dependencies

```
yarn
```

4. Run the lime app

      * Using a Qemu image


At this point we can run the limeapp on a qemu node, which actually
works but have some limitations, for example the wifi links are
difficult to emulate. Either, the actual official qemu images are, if am
not wrong, compiled on an old OWRT 18 version.

A non official and still under development OWRT 23 version exists here
https://firmware-libremesh.antennine.campiinrete.org/releases/master-ow23/targets/x86/64/

Follow the instructions
[here](https://github.com/libremesh/lime-packages/blob/master/TESTING.md#development-with-qemu-virtual-machine)
to check how to start a qemu node. Basically, this is how a command to
start a node with internet access looks like (you will need dnsmasq, and
could brake things wunning on port 53, ping me if something is not
working properly):

```bash
sudo ./tools/qemu_dev_start --verbose \
     --node-id 0 --enable-wan usb0 \ # Both optional. Node-id is used to 
run more than one qemu at once
     --libremesh-workdir . \


../qemu/ow23/libremesh-master-ow23-default-x86-64-generic-rootfs.tar.gz \

../qemu/ow23/libremesh-master-ow23-default-x86-64-generic-initramfs-kernel.bin
```

Then, everything is ready to run the limeapp

```
yarn dev
```

      * Using a real life router


Basically you have two options here, build the limeapp and send it via
ssh to the router, or run the app locally pointing to the router. I
recommend this last option because you can use the preact hot refresh
feature that enables you to see the changes instantaneously on your
browser if you change the code.

To run the limeapp locally pointing to specific router:

```
NODE_HOST=<ROUTER_IP> yarn dev
```

To build the app and send it to a router should be something like:

```
yarn build
scp -R build/ root@ROUTER_IP:/www/app
```