Author Archives: CRImier

Raspberry Pi audio jack part number

The part number for that black audio+video jack that can be seen on Raspberry Pi B+ / A+ / 2 / 3 is FC68125. I found it by accident, when I needed to source them for ZeroPhone, so I had to find the part number – and here it is =) I had to find it once again, and it appears it’s ungooglable, so I leave the part number here, hoping that it helps somebody in the future.

Disabling Raspberry Pi 3 WiFi via config.txt

Today, I had to quickly debug a Pi which had a problem – it’d kernel panic right after boot due to the WiFi driver. It was probably a software problem since it would only happen on that specific SD card – on any of the Pi 3 I have. I had to solve it quickly – and all the solutions on the internet involved editing files on the Pi ext4 filesystem. I couldn’t log in the Pi, since, well, kernel panic, and I couldn’t mount the ext4 FS because I didn’t have a Linux machine handy. I did have access to config.txt, though.

I finally found a solution on OSMC forums. The way to disable the interface that Pi uses to communicate with Broadcom WiFi is:

dtoverlay=sdhost

Insert that in config.txt and the WiFi is going to be ignored. It’s not a power-saving solution – I can’t be sure it actually turns the WiFi chipset off, but it does prevent the OS from detecting it.

SSD1332 65K 96×64 Color OLED sample code + pinout + simplest Eagle breakout

So, I’ve searched for this display’s files for two weeks. Those are cheap (3$ on eBay), but unlike all those SSD1332 displays with green ribbon of uniform width (and available drivers and breakouts). I’m not even sure if this display is SSD1332 based, and I’m not sure I care after many frustrating unsuccessful attempts to get it working. It’s cheap, however, but you do get a bare panel with a controller.

Apparently, these displays are produced by RiTDisplay. They weren’t that helpful with datasheets though and it’s not even listed on their page. Also, apparently, it’s discontinued now. The display has 27 pins, with SPI and 8-bit interface both available. I found it listed as RGS10096064FR004 on one site but the datasheet seemed to be behind the paywall.

Recently, I found the datasheet (more or less accessible), pinout information (found it before somewhere too, but it was hard) AND SAMPLE CODE! I haven’t yet checked it, but since it was hard to find, I’m sharing it with others.

Dropbox link

RGHost link

Yandex Disk link

Also, I’m sharing the simple board I’ve made in Eagle. It’s in no way complete –  no annotations, some jumpers might be missing for your purpose and you’ll have to check the pinout for your driving mode, but the FPC pitch is right and all the pins you’d need are broken out on headers. I also plan to transfer it to KiCad quite soon, so expect it to be available as well.

eagle_ssd1332_breakout

Dropbox

RGHost

Yandex Disk

The sudo fraud

Ilya's blog

Dear systems engineers,

It really amazes me how people are fine with typing sudo all the time. A kitten is denied a new toy for another day when you do this!

cat-96877_640

Typing sudo locally all the time

Is it really simpler for you to type sudo all the time rather than having one terminal tab open with a root shell? Besides, some systems even ask for a password when you run a sudo command. Be honest with yourself, are you a masochist?

Using sudo on servers

Security

Intro: each Amazon image comes with standard username for logging in. Never seen anyone changing that username.

Supposedly, the attacker would need to know the username in addition to your stolen private key. Right… and it’s not one of these: ubuntu, admin, ec2-user, centos … and looking at your ssh banner won’t give any clue as to which username is used:

SSH-2.0-OpenSSH_…

View original post 220 more words

Flashing BIOS on MSI FM2 boards with a Richland processor

Say you, like me, had a motherboard with an incorrectly flashed BIOS. What do you do in that case? Well, best case, you use DualBIOS or an integrated BIOS recovery tool. What if neither is available? Well, you get a programmer and flash it. What if then you’re stuck with non-matching motherboard and CPU because:

  • The latest BIOS version which is available as binary is not compatible with the CPU you’re on (“please update BIOS for Richland”)
  • You can’t get another CPU in less than a month and a lot of money
  • All the versions which support your CPU are available only as self-unpacking EXEs which seem to work only when you’re in Windows, which you don’t seem to be able to do because the BIOS is not letting you:

20160306_120756

Fuckers.
Well, there actually is a solution.

  1. Get a flash drive, put MS-DOS on it (either format it using Windows =<7 and that checkbox which is there)
  2. Put that damned EXE on this drive and insert it into the motherboard (rear USB 2.0 ports preferred, the ideal orifice would be located on the body of the person responsible for a decision of not providing ROMs)
  3. Boot and press F1 to go into that damn BIOS
  4. Go “Settings”->”Save and Exit” -> override boot order and boot into that flash drive
  5. Enter “dir” to see the filename of the BIOS flashing tool
  6. Run it and reboot when it allows you.

Voila!

The boards on which this should work, according to the BIOS release notes:

FM2-A55M-E33 /FM2-A55M-E23 / FM2-A55M-P33 / FM2-A75MA-P33 / FM2-A85XMA-P33

You might have some luck with other boards, too. This approach worked for me with FM2-A75MA-P33.

CTRL-EVENT-REGDOM-CHANGE on latest Raspbian Jessie Lite

I’d get following errors when I ran wpa_supplicant to connect to my home network from Raspbian Jessie Lite (using CLI, of course)

wlan0: SME: Trying to authenticate with 0c:xx:xx:xx:xx:xx (SSID=’MYSSID’ freq=2412 MHz)
wlan0: Trying to associate with 0c:xx:xx:xx:xx:xx (SSID=’MYSSID’ freq =2412 MHz)
wlan0: Associated with 0c:xx:xx:xx:xx:xx
wlan0: CTRL-EVENT-DISCONNECTED bssid=0c:xx:xx:xx:xx:xx reason=3 locally_generate d=1
wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD

It turns out that wpa_supplicant runs as a service and is to be controlled through wpa_cli. You can go that way, or you can simply killall wpa_supplicant if you’re in a hurry and run  the usual command line, and the errors will go away.

Black Swift board – connecting to WiFi network using UART

Hi! Today I’m showing you how to connect to a wireless network using serial console (or SSH over wired LAN, for that matter) in OpenWRT.
bsb_serial_login

Disclaimer: this tutorial is mainly focused on Black Swift boards, which are nice boards running OpenWRT, but I believe it should apply to most of the OpenWRT boards.

Connecting to WiFi using serial connection might be necessary because you’ve got WiFi connection as the only other way to configure your board but you need to connect to the Internet somehow, for example, to download updates. Not to mention it is kinda is hard to change settings on a connection you’re using to change them, one wrong move/glitch and you’re cut off, needing to reboot the board and restart =( Say, you’ve got a Black Swift Pro board with USB-UART embedded, or you have connected an external USB-UART to your BSB Basic, doesn’t matter. What matters is that you’ve got a terminal at your service, and that ain’t going anywhere – even if WiFi goes down. … I like serial consoles. They’re reliable.

By the way, I’m overriding the UCI configuration. It’s temporary, so not gonna get saved anywhere. For UCI configuration there are many other guides, which I need not repeat here – these are plain old command line tools. If this guide gets outdated at some point, do not hesitate to contact me using comments or e-mail.

Say, your network interface is wlan0 – one can never be too sure, what if you were using an USB-WiFi dongle? If in doubt and things go wrong, check.
Now you need to issue a couple of commands to connect to your WiFi network of choice. I suggest you follow this guide, it has info about using different network encryption types with iw utility. For me, I had to use wpa_supplicant because my network is WPA2 protected. For this, I needed a file with network’s PSK, and that file is usually generated by wpa_passphrase command-line utility. BSB’s firmware provides no wpa_passphrase tool in the default image, however, you can run it on any Linux machine and then just copy the output over.

If you don’t have a Linux PC with this tool nearby, there’s also this option:
1. Take this configuration:

network={
    ssid="MYSSID"
    #psk="passphrase" #network password goes here, but this is not necessary
    psk=59e0d07fa4c7741797a4e394f38a5c321e3bed51d54ad5fcbd3f84bc7415d73d
}

2. Generate the PSK part on this website
3. Fill in the fields according to the field names and save this in a file.

Then, you have to start wpa_supplicant like this:
wpa_supplicant -iwlan0 -cwpa.conf, where wpa.conf is the file you’ve just generated.

Hit Ctrl^Z when you can see it has connected to the right AP to free the terminal, then send wpa_supplicant to background with bg command.
You can use iw dev wlan0 link to verify you’ve connected to the wireless network, if you’ll be unsure about that.

Check if DNSMASQ is running – it’s most likely serving DHCP addresses on the wireless network you just connected to, you’d want to avoid that.
ps |grep dnsmasq
Once you know the PID, just kill it.

Okay, now getting the address by DHCP.
udhcpc -i wlan0

We should have basic connection. Check network connectivity now:
ping 8.8.8.8

However, we don’t have DNS working, the reason is that DNSMASQ is used as a caching DNS server and therefore it made itself a system-wide DNS server, and we just had to shut it down. We need to edit /etc/resolv.conf and replace “127.0.0.1” in there with any DNS server, be it your router, your provider’s DNS or one of public DNS addresses. I chose 8.8.8.8. When done, test it:
nslookup google.com
If the results are reasonable, you’re good to go. Now, set up whatever you need to set up. For me, I finally could do opkg update – I’ll tell you about that one later =)


 

Bonus: connecting USB-UART to the Black Swift board

(Basic, as the Pro boards have USB-UART on the board)
Requirements:

  1. A USB-UART dongle with suitable logic levels – 3.3V max. If in doubt, plug it in and check RXD and TXD lines’ levels from the ground. None should be above approx. 3.3V.
  2. A couple of sufficiently thin wires (I used male-male breadboarding wires, as you can see on the pictures below). If you don’t have headers attached to your BSB, you can solder those wires right into the connection holes on the BSB.

Diagram:

BlackSwiftToUART

You can safely swap the RXD/TXD lines, and you might need to because different manufacturers label them differently. If you plug in the board but see nothing in the terminal, most likely that’s what you need to do.

UART parameters: 115200, 8n1

20160104_023652

Tip – if you don’t have 5V line on your connector, you most definitely won’t burn your GPIO by connecting wires to it accidentally 😉

20160104_031908

I was surprised that my BSB breakout had GPIO columns swapped. I soldered UART wires incorrectly the first time before my gut feeling warned me I should check the pinouts before plugging it all in.

20160104_014908

The wires – beware, they are plugged in wrong holes on this picture!

20160104_032726

End result, up and running great.

Oh, and if you will have problems running a counterfeit USB-UART adapter based on PL2032, like the one I used, I highly recommend visiting this site for drivers. Worked like a charm on Windows 8 x64.