0 Comments

At first glance, it seemed to me to be a really easy task. Install QEMU for Windows, download latest Raspbian and run! Unfortunately after whole evening of tries I still fail to have it usable anyhow. Maybe it’s not totally not running, but still it’s pretty useless in terms of any further development of application without a device. Simply, at current state (as of 2018-02-18) of QEMU, it doesn’t support emulation of the USB controller, and since the whole network relays on it, there are huge connectivity issues (no network interface at all, so no SSH, no tools installation, no file transfers neither).

Just for reference, here is the tutorial I followed, not to be very bold, that I have discovered everything myself. I appreciate the work already done by QEMU team and others involved. I only hope they can emulate BCM2836’s USB anytime soon…

Probably since the spec of the USB controller is not publicly available, it makes the whole thing harder and that’s why the emulation not yet available. Although I found some article describing try of porting the USB driver itself into the Xinu OS running on Raspberry Pi. Maybe this could be used somehow to create the opposite.


OK. That’s a NO GO for the moment. Is there any other solution?


Well, yes, there is. After a while, it turned out that there are plenty of people (here, here or here) doing some heresy, but at the end of the day, it works. Instead of running Raspbian on emulator of the Raspberry Pi hardware, they use the ARM Versatile/PB board, which works somehow as expected. Among the best, it has network working!

This is pretty amazing, but also has some own quirks. First – a set of kernel patches must be applied to make it boot. Secondly it can handle only up to 256 MB of RAM (qemu exits with an error, when more is specified). Should be enough to start the device, but it’s quite low for some serious scenarios of audio/video processing. Thankfully Dhruv Vyas prepared required QEMU binaries in this open-sourced project (well, took over the work after xecdesign.com went down few years ago and is updating it along with all recent Raspbian releases). Great job!

So after downloading updated kernel, it’s just a matter of issuing single long command (Windows 10 shell):

"C:\Program Files\qemu\qemu-system-arm.exe" -m 256 -M versatilepb -cpu arm1176 -serial stdio -no-reboot -kernel kernel-qemu-4.14.79-stretch -dtb versatile-pb.dtb -net nic -net user -append "root=/dev/sda2 panic=1" -drive format=raw,media=disk,index=0,file=D:\Raspi\2018-11-13-raspbian-stretch-lite.img

Update paths accordingly to your installation. Then QEMU will start fine.


PS.

One final note. It would be recommended at the very beginning to enlarge the SD card image to get some extra space for new programs to be installed.

This could be done with following command:

"C:\Program Files\qemu\qemu-img.exe" resize D:\Raspi\2018-11-13-raspbian-stretch-lite.img +2G


That's all. Have fun!

0 Comments

Some time ago I have written a post about, how to setup Windows 10 to wake it up remotely via network using magic packet. The question that remained unanswered is: how to actually send this packet to the PC to trigger it running.


In the first example I will use Raspberry Pi with Rasbpian Stretch Lite installed:

1) First make sure a tool etherwake is available. If not, this could be fixed with following command, otherwise skip this step:

sudo apt-get install etherwake

2) Then simply invoke it with proper arguments:

sudo etherwake –i <ethernet-interface-name> <PC MAC-address>

Some explanations:

Yes, it will ask you for a password, each time you try to call it. Also MAC address should be specified in format “XX:XX:XX:XX:XX:XX”. That was the easier part.

The harder part is that etherwake by default tries to use eth0 as the network interface, where to send the magic packet. Raspberry has a feature called “Predictable network interface names” enabled by default (since August 2017 I think; was even in Jessie edition, but was disabled by default). With a big probability the name of the interface will be different than eth0 (something like enx?? or wlx?? depending if using LAN or WiFi and ?? should be replaced with Raspberry’s own MAC address).

To list existing network interfaces type this command:

ip link show

Then grab the proper name, which is not a loopback. Or use raspi-config (via command “sudo raspi-config”) and navigate to “2: Network Options” and disable predictable network interface names, so it should go back to using eth0 and wlan0 names.


In the second example I wish to show, how to achieve the same effect on Synology NAS station.

If your DSM is really old, you could use the optional package manager named ipkg. Though this manager make sure wakelan utility is installed. And waking up a PC is just a matter of issuing following command in the console:

export PATH=$PATH:/volume1/@optware/bin/

wakelan –m <PC MAC-address>

MAC this time is in format: “XXYYZZXXYYZZ”.


On the other hand, if you don’t want to play with custom package managers and have a decent DSM 6.x on-board, one could use the build-in synonet utility (as also described here). Then it’s just a matter of calling it this way:

sudo synonet --wake XX:XX:XX:XX:XX:XX eth0

Executable is located at: /usr/syno/sbin/synonet


And that’s all. Have fun!

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

Some time ago I have shown how to configure automatic build of SSIS projects (SQL Server Integration Services). Unfortunately they require full version of Visual Studio installed on a build machine as it’s an overwhelming plugin (not only a toolset), what potentially could hit me back.

And well, of course it failed and hit me after 30 days! Turned out Visual Studio 2017 Community Edition expired and was refusing to cooperate more, producing this nice error log:


[12:08:30][Step 2/3] Starting: C:\TeamCity\buildAgent\temp\agentTmp\custom_script7138984668293949066.cmd
[12:08:30][Step 2/3] in directory: C:\TeamCity\buildAgent\work\2906b7d01f979ef5
[12:08:51][Step 2/3] 
[12:08:51][Step 2/3] Microsoft Visual Studio 2017 Version 15.0.27428.2027.
[12:08:51][Step 2/3] Copyright (C) Microsoft Corp. All rights reserved.
[12:08:51][Step 2/3] 
[12:08:51][Step 2/3] The license for Visual Studio has expired.
[12:08:51][Step 2/3] 
[12:08:52][Step 2/3] The evaluation period for this product has ended.
[12:08:52][Step 2/3] Process exited with code 1


Nothing simpler, I run Visual Studio and entered my credentials, that created a proper license etc. All the warnings on UI were gone. All was supposed to go back to normal, but somehow the same log appeared again.

Till now, it was actually my naïve thinking, as Visual Studio was launched in a context of a totally different user than the one used when I double-clicked the shortcut icon. Build system operated as the local system account, since it was the “TeamCity Build Agent” service that was configured to start it.

I tried to use RunAs plugin for TeamCity. I installed it, created dedicated BuildTool user, even configured in “Build Features” section of the build configuration. Of course I run Visual Studio as this user and entered obtained again the license. But automatic build process was still failing with this log:

[13:12:58][Step 1/3] MSBuild output
[13:12:58][MSBuild output] Access is denied.
[13:12:58][MSBuild output] The current directory is invalid.

I should have probably focused more on this message and grant read/write access for new user to the buildAgent folder (as this is the place, where the sources gets populated and processed) and that would be probably the final solution (even mentioned here). But since I am hot-tempered, I moved to another try.

Next, I reconfigured the whole TeamCity Build Agent service to start as BuildTool user. I added proper login permissions (to allow it to boot the machine, login as a service etc., more here), along with access to mentioned above folder.

TeamCity Build Agent service log-on properties

Since now on, I had no issue anymore and all builds successfully again.


Congrats!

2 Comments

Some time ago I read a post from Jakub Jędryszek about using a boogie board to make notes. The theory behind it was good enough to convince me to buy one from Gearbest.com. And to be honest I also recommend this toy after such a short period of time. The quality of sketches is amazing for daily tasks for such a low price! Although when I gave it to my kids I wish there was a button (second one) to preserve it and save somewhere as a bitmap image.

Anyway… where is my real problem here?

Well, till that day everything I ordered from Gearbest.com I did using a regular mail. I knew the delivery wasn’t the quickest in the world, but at least it was always predictable. And at the end, if not delivered directly too me, I could pick it up from my local post-office after being notified with aviso.

For that particular order I left the default method – i.e. DPD(UK) carrier service without further thinking. It was really express delivery I must admit. So quick that I almost missed it. Why? Because it’s my fault of course. So please, not treat my further description as a complain. I wish rather to explain, what were my mistakes and where to obtain information they will ask you if you start talking.

The story context is - from Gearbest.com I received a parcel number and I was supposed to use another website (17track.net) to keep tracking of the parcel’s status. What I did, simply checking once per few days, not every hour as I expected it to take at least a month. Then after two weeks, I got a call from an unknown number in the middle of my working hours and the same number tried once again on the next day. That’s it. No email, no info, no SMS about anything, no aviso. Even the status on 17track.net was not updated at that time. I didn’t even expect those calls to be related with my order as there are lots of maniacs in Poland that once you establish a company (be even self-employed) and make your phone number public, they constantly call you trying to sell almost anything, especially a loan.

Then I have seen the “failed” status on 17track.net and called back to be sure. And I was assured, my parcel ended up in a warehouse. Now I could only contact with support (PL phone: 225775555) for help. And here is the crisis: Gearbest provided me 10-digits-long parcel number, while the impatient girl on the other end of the line couldn’t do anything for me without 14-digits-long number. She insisted I should contact the seller first to get the valid number and then contact her again. It changed nothing, when I said, the package was supposed to come from China via DPD(UK). She couldn’t search via name, my phone number nor destination address. Madness!

How could I get the extended number? I didn’t see myself calling Gearbest support and even though, I have seen them saying the number was correct. I could have seen the correct status on the website they provided!

Just by pure accident I opened the www.dpd.co.uk website (not the www.dpd.uk) and entered the short tracking number. What’s even more scary – both sites look exactly the same, but the other website was not giving any results (identically as its polish counterpart www.dpd.com.pl) while the first one produced something like this:

dpd.co.uk


And here I noticed the current status (now: delivered) and full parcel number. The number I got from Gearbest was simply prefixed with “1550” and that’s it. I called DPD(PL) again and this time they believed, this package was for me!


Really funny story! Thx.