Note that this tutorial should also work for any device upon which you can put OpenWRT (ie any compatible old router you have kicking around).
With this project, what I was really trying to do was create a legitimate ‘mesh network’ but my skills and time ran out so I resolved to have a ‘half victory’ which was to be able to use these little devices to expand our home wifi with small size footprint and lower energy usage, even if it was just on demand, as needed. For example, if I needed wifi to reach outside while gardening so I could listen to streamed music, etc, I could plug one of these in nearby and extend the range instantly.
Before beginning, it’s important to note that this process may need your critical thinking to build on what I’ve done, and if you have further progress, it would be appreciated by all to know, if you could write them in the comments. For full disclosure I fried two Zsun devices while learning so make sure to heed my advice in the other blog if you are using this device.
Oh, one last useful statement: I recommend turning off the wifi in your master-router so that you (you) don’t get confused by which wifi radio device you are connecting to since both devices will, by the end of the tuturial, be sharing the exact same SSID. It reduces confusion and headaches to turn this off (just the wifi, you can use wired connection if you have access). Also, while you are turning it off, take note as to what channel it is broadcasting on since you will want to choose a new channel that is far away from this one on the new device.
Ok, let’s get started.
Setting up the Device as an Access Point
For full credit I pulled the methods for this process from this video, but the video wasn’t super helpful because it required an internet connection to do the changes and I needed a static page with text instructions! These are those:
Step 1: Set up the Interface
- Go to ‘network’ and ‘interfaces’ in the sub-servient (new word I made, enjoy, GNU license word..gnucabulary…) device (in my case the zsun).
- If you have any other interfaces besides ‘LAN’, remove them as they won’t be used
- Edit the LAN
- Change the IPv4 field to the static IP address that this device will have on your main home network.
If your main router is 192.168.1.1 for example, then you could set this to 192.168.1.5 if it’s available. If not, find one that is and set it. And don’t lose it! You will need it to log back into the router after making the change.
- Change the gateway IP address to the master (gnucabulary…) routers (ie. 192.168.1.1 if that’s your router’s admin login page)
- In the “DHCP Server” settings below on the same page, there is a checkbox called ‘ignore interface’. Check that box which will disable DHCP (the thing that sends out IP addresses to all your devices) since you won’t need it
- “Save and Apply’ button at the bottom
Reminder note: your device will no longer be found at 192.168.1.1 if that’s where you just logged in. It will now be accessible at the address you chose in step 4 above. I always forget this one, ha. Go find it and log back in…
Step 2: Disable the Firewall
- Go to ‘System’ and then ‘Startup’
- Scroll down until you see ‘firewall’
- Disable it by clicking on the ‘enabled’ button
- ‘Submit’ button
Step 3: Adjust the Wifi settings
- Go to ‘Network’ then ‘wifi’
- Edit the active wifi entry
- Change the channel (1 to 11) of the device to one that is fairy far away from that of your main router so there is a nice gap between the frequencies
- In ‘Interface Configuration’ section, change the mode to ‘access point’if it isn’t already
- change the SSID to exactly the same one as your main router (if it’s slightly different it won’t work)
- Change the WPA2/psk password to exactly the same one as your main router is outputting. If you don’t it won’t work
- ‘Save & Apply’ button
Some Follow up Notes
As hinted at at the very beginning of this tutorial, from this point on you will not (or may not?) be able to access your subservient device while the wifi of the master router is on. The reason for this is because probably your computer will find the master router’s wifi device and connect to that. I had big struggles trying to find this device again. If you need to access it, either unplug your master router (honestly this is the easiest way if no one will be angry at you for killing their internet) or go into the master router’s settings and disable the wifi transmit. For me, I recommend turning off the master router’s wifi transmit until it’s all setup on the subservient first.
I had quite a bit of problems, even though my master router wasn’t transmitting wifi, connecting to my newly-IP’d subservient device. After I cleared my browsers cache it did re-appear but I’m not sure that’s why. You might need to mess around with your browser to be able to hit the admin page again. I think my problem might be because I have multiple devices running OpenWRT and the browser gets confused…
Special thanks to all the contributors at OpenWRT!
For this tutorial, we shall assume that you already have:
- An existing Matrix chat room of which you are administrator and
- A Telegram supergroup with admin rights to add members
- The Matrix room is set to “Anyone who knows the room’s link, apart from guests” in the “Who can access this room” settings of the group
- Encryption is turned off (otherwise bridge won’t work)
Let’s continue assuming the above to be true.
1. Add username “@tchncs_bot” to the Telegram group to which you wish to bridge Matrix
Do this in the usual way you add a member to a Telegram group.
2. Send Request to Telegram Bot to get Alias Info
In the Telegram Group chat text input area, type
And then send as a message to the group. It will spit back a long paragraph including this key information:
3. Invite the Alias Bot to the Matrix group
This step should be ok by any regular member of the group (no admin needed)
Invite this user to your matrix group: @aliasbot:tchncs.de
You should see message “Alias Bot joined the room”
4. With Full Admin Rights to the Matrix Group, Bridge it!
You will not be able to do this with anything less than full admin rights.
In the chat text input area, enter:
and send it (of course replacing the numbers with the ones you got in Step 2 above)
5. Enjoy your newly built bridge
Ubuntu Touch is awesome. Nextcloud is also awesome. Put them together and you have awesome… squared. How cool would it be to have your photos automatically sync to your own Nextcloud sever? Well, you can do it today and here is how.
EDIT DEC 24, 2018 – Important Security Warning before beginning!
Currently as of the time of this post, UBsync is not very secure. The volunteers who forked it are not security experts and the password file is not secure and is in plain text. Therefore, be warned that if your content is of extremely private nature, do not use this blog contents until the app has been properly updated.
However, if you are just trying to move your selfies from your phone to your Nextcloud for safe-keeping, this blog will suffice and hopefully in the next little while we’ll have some helpers in the project to improve the way the password is handed.
Also, there is a way to mitigate some risk so that at least your main NC user/password cannot be high jacked. When you log in to your Nextcloud user settings through a browser and go to ‘Security’ and ‘Create new app password’. Be sure to save this password right away during creation and in a safe place because you can only see the password one time (you can’t come back and see it again).
Once you have this password ready, continue with the blog.
- Make sure that you have a user account and password from a Nextcloud server.
If you don’t have a nextcloud user account, consider strongly hosting your own. You can do this on an unused computer, or using Nextcloudpi on a Raspberry pi, or host a more ‘serious server’.
- In your Nextcloud user directory, create an appropriate directory to put your Ubuntu Touch files in. If you don’t touch anything everything will go into your ‘Photos’ folder by default.
- Make sure you have the UBsync app installed from the OpenStore
- Go to System Settings in Ubuntu Touch
- Go to ‘Accounts’
- Select ‘Add Account’
- Select ‘Nextcloud’
Note: If you try to add an account and it doesn’t respond and take you to the next step, you may need to reboot your device.
- Enter your Nextcloud credentials (from the ‘new app password’ you created at the very beginning)
- Open UBsync App on your Ubunt Touch device
- Select ‘Add a New Account’
- Select ‘allow’ if the prompt is showing the correct username with the correct server address
- Go back to ‘General Settings’ screen of UBsync
- Set your sync frequency.
- Select any other changes you want on this page.
- Go back another screen with the back button top left
- Select the folders on your device that you want to sync to your Nextcloud with the ‘Sync Folders’ option.
The default option will put your Ubuntu Touch photos (unedited) into the /photos directory (which is a default directory when Nextcloud creates a new account) from the following Ubuntu Touch directory
- Add a new folder with the + plus sign on the top right.
Select the directory on your UT device you want to sync. NOTE: This is the tricky part, the big ‘tick’ check mark in the center of the screen is not ‘touchable’ but is trying to direct you to hit the ‘tick’ in the top right menu!
Do the same actions for the remote folder.
If the Folder doesn’t exist you can create a new one easily by just typing it. After creating it, touch it again and hit the ‘tick’ in the top right to make it real.
- When complete, press the back arrow at top left of ‘sync settings’ title.
- Start the sync
Select ‘sync service’ and then the green ‘sync’ button. NOTE: Make sure you are on wifi if you allowed your settings to use both cell phone data and wifi as the sync could be pretty big, especially the first one while it pulls the files from your phone and moves them to nextcloud.
How to Delete an Account un UBsync for Ubuntu Touch
- Go to System Settings in Ubuntu Touch
- Go to ‘Accounts’
- Touch ‘Nextcloud’
- Select ‘Remove Account’ button
That’s it. The account is now removed/deleted.
OpenWRT project is awesome for sure. It’s free software (open source) and it allows you to use your router the way you want, unlike how they usually come out of the box. That said, there doesn’t appear to be a super vibrant community around it (yet) so some stuff is pretty hard to do. I’ve created an OpenWRT English-speaking Telegram Group (for now) in hopes this might help some more community building.
Anyway, here is what you came to this blog for: Making the DDNS service work in your OpenWRT router – in my case, specifically, this is a Dlink DIR-615 router and I’m working with No-ip.com so you may need to adjust a bit according to your service. But if you have NO-IP or haven’t started yet, then maybe just use No-IP?
Let’s do it.
- Get your OpenWRT router setup with OpenWRT. If you happen to have a Dlink DIR-615 – bonus! Here is my blog post to that. If not, it might still be useful or inspiring for helping you get rolling.
- At the top of the router menu options, go to ‘System’ and then ‘Software’ and click the ‘update lists’ button.
This will pull all the possible packages you can install into your router from the community.
- Before installing other packages, install package named “luci-app-ddns.”
It ‘seems’ that this also installs ddns-scripts when you install this which is another one you need so it’s nice it’s automatically installed with this package.
Important Note: If you cannot find packages, or something is strange during package install, you may need to reboot your router to free up some RAM memory. This happened a few times and after rebooting the router I was then able to update the lists correctly.
- Using the same method as the step above, Install the No-IP package for OpenWRT called “ddns-scripts_no-ip_com”
A tab called ‘Services’ should now appear at the top of your router’s menu options because you performed step 3 above. Verify this is good and if some problem, repeat the above steps until you have your tab and possibly you will need to reboot router (see important note above)
- Under new ‘Services’ menu dropdown at top, “Dynamic DNS’ should now be an available option. Here is a link to some No-IP documentation for the client that I found useful. This link here in the ‘OpenWRT configuration’ section was also helpful to me for your reference although it wasn’t No-IP specific.
- In the ‘add’ field at the bottom left, give your service a listing name (I used ‘Noip’ for mine) Then click ‘add’.
- In the DDNS Service provider[IPv4] field, select “no-ip.com” from the dropdown list. Note: even though this is later in the order of fields, do this now.
- Press ‘change provider’ button
- For the ‘Lookup Hostname’ give it your No-IP custom URL without the “HTTPS://” stuff.
- In the “Domain” field, put the same info from step 7 above.
- username = your No-ip username (maybe your email?)
- Password = you guessed it! Your password for the No-IP service
- Under ‘Advanced Settings” I selected “https:// checkip .dyndns .com” from the “URL to detect[IPv4]” field. I found No-IP service wouldn’t work until I chose something from this list. It wouldn’t seem to point No-IP to my router without it…
- ‘Save and Apply’
- At the top right you might (I can’t remember to be honest) see a notification that you have unsaved changes in your router. If so, go and apply those changes to your router.
- Go back to overview list where you started. You should now see your new entry
- Click the ‘enabled’ checkbox
- Press ‘start’ button. You should now see a PID and a number with it and a red icon.
Now, you should be up and rolling and after No-IP has a bit of time to apply the changes your router should now be accessible by the URL you put in step 8 above.
The funny part about this blog is that I spent an entire day searching for how to do this and then I ended up landing on a blog post with the answer… written by ME. in this 2015 blog post Lol or something?
This tutorial assumes you are using Ubuntu and know how to access your terminal and do some basic commands. If not, do a quick study on that before you begin. If you aren’t using Ubuntu on your computer I’m not sure what I can do to help other than encourage you to switch immediately.
This tutorial also assumes that your computer/laptop is plugged directly into the DIR-615 router by ethernet cable and not by wifi. It could probably be done with wifi, but I don’t know and I know it adds an extra layer of complexity I don’t like. So find a cable and plug in to do all this.
1. Download the appropriate image from OpenWRT to your computer.
I got mine by refining a search here.
2. Extract the file into it’s raw ‘.bin’ format.
Mine looks exactly as follows at the time of this writing when it’s sitting in my directory but as versions change and improve this could slightly change be aware:
3. Using your terminal cd (change directory) to the location where the file is you just extracted in step 2.
4. Make sure your computer is set to a static IP address.
If you don’t know how to do this, search it online as I don’t have a quick link to it right now. “How to set static IP address in Ubuntu’ should find something. Make sure that your static IP address you are setting does not conflict with another device on the router, nor with the router itself at 192.168.0.1.
NOTE: After this router is flashed you will need to get rid of this static IP address since it won’t match your new router!
5. Pre-enter the following command into your terminal so you are ready to press enter
curl -0vF firstname.lastname@example.org http://192.168.0.1/cgi/index
Again, the part after the @ symbol in the command above might change depending on the .bin file you are flashing on. This tutorial will likely get old at some point so you may need to swap out a different file name into the command above but the rest should work long term.
6. Power off the router by unplugging the black power cable
Warning. You are about to forever wipe your router’s ‘operating system’ so if you have anything in there you care about this would be the time to get those out!
7. Put pen in the reset button of router and hold it there
8. While still holding reset button, plug in the power cable.
Keep holding the reset button! Don’t let go. The light will be a solid colour (orange, I recall?) but you are waiting for the first flash before executing the next step.
9. As soon as the solid light starts to flash hit the enter key in your terminal and run the curl command you pre-entered in step 5 above
After you hit this command at the perfect moment, things should start to work. When they do, you’ll see some funky html stuff come on the screen that looks like this:
* Hostname was NOT found in DNS cache
* Trying 192.168.0.1…
* Connected to 192.168.0.1 (192.168.0.1) port 80 (#0)
> POST /cgi/index HTTP/1.0
> User-Agent: curl/7.35.0
> Host: 192.168.0.1
> Accept: /
> Content-Length: 3932431
> Content-Type: multipart/form-data; boundary=————————464dbec1925a46d8
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Server: uIP/0.9 (http://dunkels.com/adam/uip/)
< Content-type: text/html
backup loader Device is Upgrading the Firmware
- Don’t turn the device off before the Upgrade jobs done !