WaveShare SpotSpear 4 on NOOBS/Rasperian

September 13th, 2015 by l33tm3h No comments »

Publishing this for now so other people can benefit, but its not finished.  First time install hardware like this.  I’m not familiar with everything so please correct me if I’m incorrect.

I picked up a Raspberry Pi Model A+ over a year ago.  I purchased the Waveshare 4 touchscreen a few months ago (http://www.amazon.com/Waveshare-Raspberry-Resistive-Interface-Rapsberry/dp/B00Q4OPX9Y/ref=sr_1_1?s=pc&ie=UTF8&qid=1442768981&sr=1-1&keywords=waveshare+4inch).  Here is the website that got me started setting up the LCD: http://www.circuitbasics.com/setup-lcd-touchscreen-raspberry-pi/

Step 1 – Setup X11

If you didn’t setup X11 when you first installed Rasperian, you’ll need to.  Use the following tutorial to install X11: http://askubuntu.com/questions/213678/how-to-install-x11-xorg.  I didn’t have some of the required dependencies so I needed to install xutils-dev.  Tutorial found here http://ubuntuforums.org/showthread.php?t=1367555.

Step 2 – Installing fbturbo

I didn’t have autoreconf for the next step.  Needed to install that first. http://askubuntu.com/questions/265471/autoreconf-not-found-error-during-making-qemu-1-4-0

Then needed to install fbturbo: https://github.com/ssvb/xf86-video-fbturbo/wiki/Installation

Step 3 – Configuring modules

Read Part 4 of this blog: http://www.circuitbasics.com/setup-lcd-touchscreen-raspberry-pi/ .  I’m pretty sure the name in /etc/modules has to match up w/ the name in /boot/cmdline.txt and also the speed needs to match too.  Pay particular attention to this line “The kernel module for the LCD screen is called fbtft_device and the kernel module for the touchscreen is calledads7846_device. ads7846 is the name of the touchscreen controller chip used in the Waveshare 3.2″ LCD and many other touchscreen displays.”

Step 4 – Configuring The Touchscreen

OK, so setting up the touchscreen is a little tricky.  Here are some information links about the LCD modules for the Waveshare 4 inch

After looking at that last link, I figured I would keep going along w/ theADS7843 controller.  After searching, I found this page http://raspberrypi.stackexchange.com/questions/27714/how-to-install-waveshare-spotpear-4-inch-lcd-in-raspberrypi-2. It is for informational purposes only.  http://www.circuitbasics.com/raspberry-pi-touchscreen-calibration-screen-rotation/

This fixes all the issues w/ the touchscreen:  http://raspberrypi.stackexchange.com/questions/27714/how-to-install-waveshare-spotpear-4-inch-lcd-in-raspberrypi-2

Links about fixing inverted axis:

 

Running Tenda w311m on Raspberry Pi

August 17th, 2014 by l33tm3h No comments »

The Tenda w311m is a small USB dongle that I purchased from MicroCenter for around $10.  Getting it to work so far has been a chore.  No additional drivers appear to be needed after plugging it into the Pi as the OS seems to recognize it.  If you do require drivers, here is a link to the driver page.

Manually Configuring Linux Wireless Settings

This will get your wireless adapter to work without editing any of the system configurations.  For this example, I turned on the guest network to my router.  I also assume you are not running as root (hence the use of sudo).  Source: GHacks

Configure wireless to set ssid
sudo iwconfig wlan0 essid router-guest

Configure adapter to use new settings.  This may take a minute or two to respond.  Assuming no errors, you should be connected and ready to use the wirelss.

sudo dhclient wlan0

Verify configuration has worked.  Note wlan0’s new ip address.

pi@mypi:~$ ifconfig

eth0      Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx
          inet addr:192.168.x.xxx  Bcast:192.168.x.xxx  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:849 errors:0 dropped:0 overruns:0 frame:0
          TX packets:429 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:51709 (50.4 KiB)  TX bytes:72179 (70.4 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx
          inet addr:192.168.x.xxx  Bcast:192.168.x.xxx  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1240 (1.2 KiB)  TX bytes:724 (724.0 B)

 Configuring Pi to Connect Automatically

Knowing how to connect manually is good to know should we ever need to switch connections.  However, I don’t want to connect manually every time.  Here is the configuration setting for how to connect automatically on startup.

pi@mypi:~$ sudo cp /etc/network/interfaces /etc/network/interfaces.mybackup; #-- make a backup first
pi@mypi:~$ sudo nano /etc/network/interfaces; #-- edit the networking file

auto lo #-- enable loopback

auto wlan0                  #-- auto connect on wireless device
iface wlan0 inet dhcp       #-- use dhcp on this device
wireless-essid airman-guest #-- use the following ssid

Using wpa_supplicant for WPA2

Fuck wpa_supplicant.  Use /etc/network/interfaces instead

If you installed the default Raspberry Pi OS, like I did, you notice that wpa_supplicant is used to configure networks.  Here is how your configuration may look.

auto wlan0                                       #-- auto connect on wireless device
iface wlan0 inet manual                          #-- manually configure this device
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf #-- allow wireless device to roam, but use the following configuration</span></pre>

You’ll setup your network configurations in the wpa_supplicant.conf file.  If you are connecting to a WPA enabled network you will also need a passphrase setup too.


pi@mypi:~$ sudo cp /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf.mybackup
pi@mypi:~$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
pi@mypi:~$ wpa_passprhase &lt;yourSSID&gt; &lt;yourplaintextpassword&gt;

Your wpa_supplicant.conf should look similar to.

ctrl_interfaace=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="myrouter-guest"
    key_mgmt=WPA-PSK
    psk=your_generated_psk
}

Using /etc/network/interfaces for WPA2

Followed these instructions under “wpa-psk and wpa2/psk”

pi@mypi:~$ sudo nano /etc/network/interfaces
auto wlan0
iface wlan0 inet dhcp
    wpa-ssid mynetworkname
    wpa-psk mysecretpassphrase

References:

Linux Log Scanner

August 28th, 2014 by l33tm3h No comments »

In an effort to become more familiar with the type of logging that occurs within a Linux environment, I’ll be creating my own log scanner. Yes, there are likely better utilities out there which do this better than I do…right now, but how am I ever to learn?

So far, I will be analyzing the following logs

  • /var/log/syslog
  • /var/log/messages
  • /var/log/auth

The code can be found here: l33tm3h on github