Wednesday, January 10, 2018

MNO LAN: Use same MNOs SIM card in your IoT devices like GL-MiFi

One of the big issues with IoT is somehow enabling two end nodes to communicate with each other in the presence of Network Address Translation (NAT)
Now days most ISPs (and Mobile Network Operators or MNOs) use NAT by default and assign you local IP addresses in 10.*.*.* subnet. You usually have to pay an extra fee to get static global IP addresses assigned to you - this could be a security concern.
If your end nodes run embedded linux, the following solutions can be used:

  1. Use DDNS and UPnP together
    DDNS is not usually free, but the manufacturer of your embedded linux device (routers from goodlife of Vstarcam's IP camera) might provide you this service for free as it uses almost nil resources on the server side. Most ISPs have UPnP support disabled on their gateway. In a home environment, if you have your own static global IP for your home router, you can use UPnP and DDNS to your advantage. An end node will use UPnP to request your WiFi Router to open ad forward certain outward facing ports to it and then. It will then detect the global IP address of its parent's gateway (in your case, your own home router) and register it with its DDNS server. You can then use the URL assigned to the device to access it from anywhere in the world.
  2. Use Virtual Private Networking
    Pay for a virtual private networking service and use OpenVPN clients on your end devices and bring them all on the same LAN
  3. Use
    Its a paid reverse SSH relay service. Works well for SSH and HTTPS connections to your device
  4. Use a server with a global IP address
    Rent virtual VM from digital ocean or amazon or google and develop software for your devices to send data to or receive data from. this is what most manufacturers do for their IoT appliances.

There is a 5th option if:

  1. You are working on a DIY project - handful of embedded linux devices with SSH access.
  2. Your devices are located in the same geographical area (i.e. within the same telecom circle)
  3. Your devices have 3G/4G modem
The trick is to stick the same network operators SIM card in all your devices. All these devices will be assigned IP addresses on the same subnet and would be able to ping each other.

The 10.*.*.* only allows around 16 million unique IP addresses and so I have reason to believe that in India, different MNO circles would be on different logical LANs

Here are the results of my tests - I used two GL-MiFi with 4G modems in them with Reliance Jio 4G SIM cards. Both the devices were located within Maharashtra (one in Pune and other in Talegaon)

I opened the outward facing ports on GL-MiFi and deactivated the firewall on them.
I then conducted iperf tests and here is what I got. It seems that we can easily transfer data between the devices at around 1-2 Mbps while on the Jio network.

Results. PDF is here.


We all want our smartphone to charge quickly. And different phone manufacturers have either created their own propriety method of charging (Oppo VOOC or MediaTek PumpExpress+ or Motorola's TurboPower or OnePlus's Dash) or have opted to comply with a industry wide standard like Qualcomm's Quick Charge series of standards).
These technology work my allowing a phone to tell the charger to step up the voltage beyond 5 volts so that the power available to the phone for charging the battery is more than what a good 5 volt / 2 ampere wall/car charger can supply.

I have a Moto G4 plus and I wanted to make sure that I had access to fast charging at home/office, in car or while travelling. So I went ahead and got the following accessories

My Moto G4 plus along with the various charging accessories


USB Voltmeter Stick

  • This small device is what allowed me to check at what voltage/current the various chargers were charging my phone or regular devices.
  • It has a USB male and female receptacle so that it can sit between the charger and the USB cable.
  • It shows the voltage, current as well total mAh consumed during the past few hours - all these 4 parameters are shown on its OLED display. It ofcourse discounts the current it itself requires.
  • A reset button will allow you to reset the energy and time counter - The energy and time counters are stored in its non volatile memory and their values are preserved across power cycles so you need to reset them manually.
  • ₹777.00 at

Original TurboPower Charger that cam with your mobile phone

Wall Charger
  • Comes in the box when you buy your phone
  • There re two varieties of these chargers - one has a USB female socket in it and comes with a  detachable microUSB cable while others have microUSB cable connected to it permanently. I have both of these but prefer the one with USB female socket
  • When I used the voltmeter to investigate the charger I discovered the following:
    • It charges regular devices at 5.0 volts
    • It charges Moto G4 plus and Moto G5s plus at around 9.0 volts
    • It charges Qualcomm QC 3.0 compatible devices at around 11.5 volts
  • Thankfully, its 2 pin has the correct diameter and distance between them to fit snugly in Indian AC main sockets - unlike those sad chargers which have europlugs which hang loosely when used with Indian sockets.
  • ₹1,364.00 at 
Charging a regular device at 5.0 volts

Charging Moto G4 plus at around 9.0 volts

Charging a QC 3.0 Power Bank at around 11.5 volts

TurboPower Car Charger

Motorola Turbo Power 15W Qualcomm 2.0 Quick Charge Car Charger (Black)
Car Charger
  • This charger is small and compact and is an original Motorola accessory which is bought separately.
  • Supports QC 2.0 devices (Qualcomm QuickCharge)
  • When I used the voltmeter to investigate the charger I discovered the following:
    • It charges regular devices at 5.0 volts
    • It charges Moto G4 plus and Moto G5s plus at around 9.0 volts
    • It charges Qualcomm QC 3.0 compatible devices at around 11.5 volts
  • ₹990.00 at 
Charging a regular device at 5.0 volts
Charging Moto G4 plus at around 9.0 volts
Charging a QC 3.0 Power Bank at around 11.5 volts

LCARE Qualcomm QC 3.0 Quick Charge Power Bank

  • Now that I had charger for fixed sockets (Car and AC Mains) I wanted a portable power bank with fast charging technology as well. Motorola's TurboPower seemed compatible with QC 2.0/3.0 so I tried this particular powerbank and was pleasantly surprised.
  • When I used the voltmeter to investigate the charger I discovered the following:
    • It charges regular devices at 5.0 volts
    • It charges Moto G4 plus and Moto G5s plus at around 9.0 volts
  • The QC 3.0 technology is used in input as well as output sides. i.e. when you try to charge the power bank itself using any of motorola's original accessory - the car charger and the wall charger - you notice that those chargers themselves are able to charge the powerbank at around 11.5 volts - so basically you have a power bank that not only charges other devices quickly, but also itself gets charged quickly.
  • A backlit LCD display shows the charge level remaining in percentage numbers and also shows the charging technology being used
  • One downside - the powerbank cannot charge mobile devices when it is itself being charged.
  • ₹1,755.00 at
Powerbank charging  moto G4 plus at around 9.0 volts

Powerbank charging a regular bluetooth headset at 5.0 volts

Sunday, January 7, 2018

Food Silicone food savers + Glass bottles

Plastics! Cancer! Correlation!
And so we move away from plastic bottles to glass bottles.
But glass bottles pretty but fragile.
So what do we do?

We get food huggers!!!
Food huggers seemed onle somewhat useful to me all this while until now
The silicone rubber food huggers will protect the bottom of the bottles - I was worried that I might end up banging them on the floor when I have a sip in the middle of the night.

Color Glass bottles
Silicone food hugger

 = links:
  1. Food huggers/savers
  2. Glass bottles

  1. The food huggers come as a set of 4. Only the two larger ones have diameters large enough for the glass bottles linked to above. The smaller two won't fit.
    So if you get 6 bottles, you will need to order 3 sets of food huggers. Of the 12 pieces of food huggers, you will end up using only 6 of them.
  2. Various sized food huggers seem to be colored differently to match the color of the vegetable/fruit they are supposed to protect. Yellow is for lemons, Purple for onions, Green for capsicum, Red for tomatoes. This is a good thing - food huggers come in various colors and so do the glass bottles. So there is a very high chance that you would end up getting matching cushions for each bottle except for the blue one.
  3. These silicone rubber huggers can also be used for green tea flasks as well.
  4. Also, here are some photos on how these huggers can protect half cut vegetables from drying up when left in the fridge.

Friday, January 5, 2018

Adding new elements to OpenWrt's LuCI on GL-MiFi

If you are an IoT enthusiast who uses devices that run OpenWrt (routers from Goodlife, or MT7688), you would have considered creating a plugin for LuCI so that you can expose the functionality of any sensors/actuators that you may have connected to your OpenWrt box via OpenWrt's builtin web console.

This article on's wiki will tell you exactly how to do that.
As maybe obvious from the page, if you want to create dynamically generated web content, you will need to write lua scripts.

When trying out the steps from the wiki article for my GL-MiFi, I had to modify the file locations for placing various script like so:

  1. new_tab.lua had to be placed in:
  2. cbi_tab.lua had to be placed in:
  3. cbi_file can be put in the same place as mentioned:
  4. view_tab.htm had to be placed in:
Once I had the placed the files in the right location, I could see them in the web UI:

My next step is to modify the lua scripts to run executables in C to query the various sensors that I have connected to my OpenWrt devices and display the latest values within a tab in WebUI.

I use the device specifiy SDK from OpenWrt to compile my C programs into executables.

Later on I will package my lua scripts and C programs into a simple .ipkg packages that one can install on any OpenWrt device