0 Comments

Yet, Internet connection sharing is an easy-to-use feature on my Xiaomi Redme Note 5 phone that has wasted me whole evening to get it right. Funny thing, really, since as a user I was supposed to enter Settings, navigate to Mobile Hotspot, define password and swipe to enable it. Also from that point of view, that’s all you can do, due to lack of any other configuration options. But as it turned out, there is a subtle “bug”, that causes it not to work on any Xiaomi phone (with MIUI and without).

Short story long… Of course data connection on the phone itself was always working fine. I could browse the net, connect via VPN to work network, watch YT, listen music from Spotify etc. Several times I needed to share this LTE connection with the Windows 10 laptop to perform some immediate tasks and it always failed. No matter what hour I tried, or the part of the city I was sitting. Then I mostly gave up and turned back for few moments to my BlackBerry Passport phone, where it was always working smoothly ;)

Finally I realized it’s time to find a solution to this issue. And here it is, few hours later.

I browsed the Internet and found all those misleading guides, that lead to nothing, so simply skip them:

  1. First I thought it was due to problem with the way my APN (settings for data-connection) was defined:
    • Switched to IPv6 only
    • Reset everything to default
    • Confirmed with my mobile operator, whether default is right
    • Switched APN type to ‘default’
    • Switched MVNO type to ‘GID’
    • Switched to IPv4/IPv6
  2. Set hotspot frequency to 5 GHz
  3. Reset device, place SIM card in secondary slot
  4. That all was wrong, still I could only to connect the PC to the hotspot, but no packets were actually transmitted over the LTE. Then I thought – maybe it’s the problem with Windows itself. So I tried:
    • Forced IPv6
    • Reset network settings to default
    • Hardcoded Google DNS – 8.8.8.8
    • ipconfig /renew
    • ipconfig /flushdns
    • ssh to any external server

Continuously nothing working correct, even when all the guides I have seen were claiming, it should be fine long ago. I have even found info about Samsung and Huawei devices, where IP ranges or default DNS can be defined directly on mobile.

Then boom! What if this is Xiaomi-only related “bug”. And that’s true. It flies around since several years and xda-developers.com has even a fix, that looks like:

  1. install Android SDK
  2. enable developer mode on the device
  3. enable USB debugging and especially USB debugging extra security settings (without it further commands will throw security exception; also it might require registering at Xiaomi portal as developer)
  4. connect the device via USB
  5. in command prompt type adb shell to issue further commands on the device directly
  6. check value of tether_dun_required, that in my case was `null` as described in the original fix, with command: settings get global tether_dun_required
  7. if the value is different than ‘0’, hotspot will not work
  8. to set it type: settings put global tether_dun_required 0
  9. exit shell and reboot the device


And now it works finally!

0 Comments

Even though my 13-inch MacBook Pro (early-2011) seems to be pretty old I still like to work on it. Unfortunately running Windows 10 and two instances of Visual Studio 2015 kills it slowly. Mostly because of lack of memory and continuous usage of the swap file. And totally by accident I found out that Apple cheated users in this spec of an equipment saying it can support only up to 8GB of RAM. Another unofficial spec in the contrary claimed it can easily support up to 16GB. Wow, that would be something!

I gave it a chance and bought the stuff, what nowadays was not so expensive at all:

Corsair MacMemory - 16GB - DDR3 1666MHz

 

Then followed the RAM-replacement guide on ifixit.com. Started the machine and checked system preferences on my both OSes. And looks like it is really worth the trouble!

 

MacBook-Early2011-16GB  Win10-16GB

 

Hope this helps you too!

 

EDIT 2016-07-10:

That was a correct move, the performance of the machine is visibly better.

0 Comments

Usually it’s not a big deal, when a HTTP request to a remote server is not working on a desktop Windows machine. There are plenty of useful tools, that could help in the process:

  • one, which work like a proxy and dump the whole traffic, that we might be interested in (Fiddler would be the best example here)
  • others, that interact with the TCP/IP stack itself and look much deeper for sent packets (like WireShark or Microsoft Message Analyzer).

BTW. Do you know, that there is a way to visualize HTTP traffic in Fiddler, that was originally captured by Wireshark or MMA?
Simply export packets from WireShark as pcap file (File –> Export –> Export as .pcap file) and import it directly into Fiddler (File –> Import Session… –> Packet Capture).
Many thanks to Rick Stahl, for showing me this feature.

Mobiles are totally different world. Mostly because applications are running in a dedicated sandbox and there isn’t at all internal or external access on system level. There is not much to do beside debugging of our own code. But if this doesn’t help, it doesn’t mean we stay blind. Take a look at http://httpbin.org/ (project sources available on GitHub). It’s the server you always wanted to write yourself – server that returns info about client accompanied by a list of headers, info about content for all kinds of submitted requests and even some random binary data, if you like. Respective behavior is selected by dedicated path on the httbin.org server and response is of course in JSON format (maybe beside for the binary data request).

Typically request paths:

  • /get
  • /post
  • /put
  • /delete – all of them to know, how the request really looks like
  • /status/<code> – to verify, if the application handles given error respectively
  • /bytes/<size>
  • /stream-bytes/<size> – both to download some random binary block of bytes from server.

It *won’t* simulate your destination server at all nor any more advanced interactions. And you will need to to hack your application to be able to issue requests against this server and dump somewhere the JSON response. Still remember, it’s only during application development and while fighting with a non-working request against remote server you totally have no control over, so additional #ifdef won’t hurt at all ;)

Final thought – the trick described above could be also without any problem used inside desktop or Windows Store application. It’s not only dedicated to mobiles!