Landis Vinchattle An aggregation.

April 30, 2016

More Pogoplug E02 uBoot Work

Filed under: Links,Linux — Tags: , — Landis V @ 8:13 pm

I’ve written a few times about configuring Pogoplug devices to work with uBoot and Linux.  Recently I’ve run into some problems with one of my Pogoplug E02 devices, where it would no longer boot to the attached USB drive, and didn’t seem to be booting properly to the native firmware either.  Finally got around to looking at that a little bit in the past couple of days.

Since I wasn’t able to SSH to the device, I had to open it up and connect to the internal serial console.  I had already purchased a USB to TTL serial cable adapter based on the PC-PL2303HX chipset (similar to these), so I opened up the Pogoplug and modified a CD-ROM audio cable I had laying around to connect between the TTL adapter cable and the serial port on the board (opening and serial connection documentation here).

Once I was able to get consoled in, I determined that my USB drive was only being detected properly on a soft boot.  So pulling the power cable was doing me no good as far as getting it to boot, but if I issued a reset or reboot from the failed boot environment, it would detect the USB device correctly and boot up.  While the reset command was functional, it was not practical, as it would have required a perpetual serial connection and for me to issue a reset every time it lost power before it would come up properly.  I want it to reload to normal running state automatically.

I played around with the firmware environment variables for a bit before going ahead with an upgrade of my uBoot environment (I was on a 2011 version).  I followed most of the instructions including flashing the default uBoot environment variables.  I was still having some issues with the USB drive not being detected from a cold boot, but modifying the “scan_disk” environment variable appeared to provide a resolution.  I changed the “scan_usb” portion of the command from “usb start” to “usb start; sleep 3; usb reset”, and thereafter I was able to successfully boot from both a cold start and a warm start.  The full variable after changes was as follows:

scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start; sleep 3; usb reset"; setenv scan_ide "ide reset"; setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if ext2load $dev $disknum:1 0x800000 /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done

Finally, I made some modifications to allow the default Pogo OS to load in the event a drive with a “rootfs” label was not present.  I added a “pogo_bootcmd” environment variable and modified the “bootcmd_exec” as in the following.  This appears to be allowing the device to boot the defacto Pogo OS in the event the rootfs drive is not present, though I still had difficulties SSH’ing in with my Pogo portal configured account.

pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
bootcmd_exec=mw 0x800000 0 1; run load_uimage; if run load_initrd; then if run load_dtb; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 0x1100000; fi; else if run load_dtb; then bootm 0x800000 - 0x1c00000; else if bootm 0x800000; then echo Booting; else run pogo_bootcmd; fi; fi; fi

January 10, 2015

Pogo Mobiles, SiliconDust HDHomeRun, and cabling

Filed under: Entertainment,Hacks,Home,Links,Linux,Networking,Projects,Security,TV — Tags: — Landis V @ 11:24 am

Last night I finally got around to doing a little bit with the Pogo Mobile units I had installed Debian on.  Not much so far, just got dnsmasq loaded on the unit that will become my DHCP and DNS server (replacing the same functionality on my router, so the next time I swap out a router I don’t have to worry about transferring internal DNS or DHCP reservations).

Haven’t done much of anything with the unit that I will be configuring as a CA, but did run across a couple of good reads on how to do a CA “right”.  The OCSP article fills in a piece I’d like to have if I’m going to go to the trouble of setting up my own CA “for real”.

I stopped at Charter yesterday and exchanged one of my digital cable tuners for a CableCard, so I am anxious to get my HDHomeRun set up and start playing with it.  I don’t like the way my CATV cable is organized, and it’s also older RG-59.  Having purchased some RG6, I’m now in the process of centralizing that system, pulling new cable to at least a couple of locations, and will probably use the opportunity to put an ethernet drop in my garage as well.

December 3, 2014

U-Boot w/ MMC/SD-card booting for Pogoplug Series 4

Filed under: Communications,Hacks,Links,Linux,Networking — Tags: , — Landis V @ 11:21 pm

http://forum.doozan.com/read.php?3,7477,10982

Just bought one of the mobile units today.  This thread appears to have some instructions on getting Debian set up on the SD.  Will have to come back to it when the unit arrives and I have a couple of minutes.  Thinking this could make a great router/firewall.

July 12, 2014

Arch Linux ARM • View topic – Pogo V4 A101 Mobile Hardware Mods?

Filed under: Electronics,Hobby Engineering,Links,Linux,Networking,Purchases — Tags: — Landis V @ 2:54 pm

http://archlinuxarm.org/forum/viewtopic.php?f=53&t=6040

I picked up a couple of POGO-V4-A1-01’s from eBay for $7.50 apiece shipped and thought I might try using them for sensor devices and/or generic simple alerting systems.  The hardware mod listed in this forum will be very helpful in adding another interface to the device, as my understanding is that it will only boot from the USB or the SATA port, and the device will be much more useful if the USB port is available for peripherals.

November 27, 2013

1-Wire USB Interface – CodeProject

Filed under: Electronics,Hobby Engineering,Links,Technology — Tags: , , — Landis V @ 10:40 pm

USB-Serial CH340

via 1-Wire USB Interface – CodeProject.

I’ve been wanting to do some temperature sensing/tracking for some time, and this looks like the way to do it. I’ve ordered some CH340’s off of eBay for $.99 each and bid on some DS18B20 1-wire sensors at about $1.20 each. My hope is to be able to interface these to a USB port on one of my Pogo E02’s and have a better idea what ambient temperatures are doing in my fermenting area.

October 13, 2013

Pogo unit as headless barcode scanner

Filed under: Links,Linux,Projects — Tags: — Landis V @ 11:55 pm

Now that I have a couple of Pogo devices up and running with at least a basic Linux OS, I’m starting to think about getting one of them running as a headless USB barcode scanner.  I installed usbutils on the Pogo (‘sudo apt-get install usbutils’) and am able to view its details with a ‘lsusb’, especially followed by a ‘lsusb -v -s <busnum>:<devnum>’.   I’d like to set up a (probably Perl, though I really do need to at least tinker with Ruby at some point) script to “listen” to the scanner and receive any input from it (i.e., barcode data it has scanned).  The script would then determine what to do with that data based upon a database lookup.  Scanning of grocery items, for example, might add them to an inventory for updating, while scanning of the serial number barcodes on my Black & Decker Matrix 20V Lithium batteries could trigger an entry that a particular battery serial number was charged on a particular date (so I can make sure they are charged periodically as per the user guide).

Some references from my initial research this evening:

October 4, 2013

Revisiting the POGO-E02 for ownCloud and storage

Filed under: Hacks,Links,Linux,Networking,Projects,Software,Web Applications — Tags: — Landis V @ 1:46 am

In a recent post, I reconfigured one of my POGO-E02 devices to run Linux (also in a much older post, but I intend to go back and revisit that device with the updated process at some point).  I have reccently replaced my laptop (OfficeMax had a pretty impressive flash sale on a Gateway with an AMD quad core, and huge kudos to the OfficeMax in Kearney, NE for taking care of the customer incredibly well when the one I initially picked up had a dead left mouse button and a dead F10 key out of the box… literally zero hassle getting it replaced, great job to that team).  Unfortunately the old laptop is still sitting on the desk next to the new one, soaking up space I don’t have.  I need to make sure I have everything I’ve done on it in the past year and a half or so saved off and duplicate backup copies, as there are a couple of videos I’ve stored on there that are simply irreplaceable.

Time to get back into storage.  I like my Dropbox (you should definitely sign up here if you don’t already have an account) and I recently got some additional temporary space when I bought my Samsung Galaxy S3, but my space is otherwise full and I won’t pay for more.  I think ownCloud, an older version of which I reference briefly in the second linked post above, will prove quite suitable for this, especially in conjunction with my personal CA.

I brought my Linux-ified Pogo back online and hooked up a Seagate external drive I’ve had sitting around and been meaning to hook up for quite a while.  I hooked it up to the Pogo unit and it was recognized as sdb.  From there, I performed the following (as root) to create two, 1TB partions on the drive:

apt-get install parted
#confirm installation when prompted
parted -a optimal /dev/sdb
rm 2
rm 1
mkpart
#Answer prompts with label=OwnCloud, type=ext4, start=0%, end=50%
mkpart
#Answer prompts with label=Storage, type=ext4, start=50%, end=100%
quit
mkfs.ext4 /dev/sdb1
#I only created the OwnCloud partition at this time in the interest of saving time.
#Perform a similar command for sdb2
mkdir /mnt/owncloud
#Should edit /etc/fstab and add a line similar to the following for perpetuity:
#/dev/sdb1 /mnt/owncloud ext4 rw,relatime,data=ordered 0 0
#I did, and then rebooted to make sure everything came up/remounted as expected

From there, I proceeded with the installation of ownCloud on Debian as per the instructions on the site.  I followed the link for Debian Linux, verified my version (cat /etc/debian_version) – I am on 7.1 so followed the 7.0 instructions with a few verifications.

echo 'deb http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/ /' >> /etc/apt/sources.list.d/owncloud.list
apt-get update
#Received the following error here:
#W: GPG error: http://download.opensuse.org Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 977C43A8BA684223
#Added the following steps, per http://en.kioskea.net/faq/809-debian-apt-get-no-pubkey-gpg-error
gpg --keyserver pgpkeys.mit.edu --recv-key 977C43A8BA684223
gpg -a --export 977C43A8BA684223 | apt-key add -
#Reran update to verify
apt-get update
#Success! I then noticed they had an equivalent answer in the next step :/ Oh well.
apt-get install owncloud
#Accept dependencies

Once installation completed, I opened a browser to the owncloud URL on the Pogo at http://<pogo_ip>/owncloud.  Because I intend to make my access seamless whether I’m at home or connecting from the Internet at large, I have a few tricks I need to do yet.  But first I finished up the basic configuration.  I created my administrator account and password, hit the Advanced button and set my data directory to the /mnt/owncloud/data directory using the mountpoint I had created previously.  The database was set at SQLite, so I left it for the time being.  After submitting, I thought to check and found that there was an existing “data” directory in /var/www/owncloud with ownership www-data:www-data and ug+rwx, so I created a /mnt/owncloud/data directory with the same ownership and permissions.  After refreshing the initial page and setting the final config again, things seemed to load properly this time around.

I set up a WebDAV connection from the Dolphin file browser and started transferring some of the files from the Linux laptop per the user manual.  I experienced problems transferring a few of these files and remembered something about large file support, so I went back and took a look into that.  The default max size looks to be 800MB and I didn’t have anything beyond that, so I tried a reboot; it took a long time to complete, but it seemed to work.  I backed up the remaining files I had planned on, shut down the old laptop, and was able to get it out of the way.

I downloaded the Windows client on the new laptop and installed it.  When installation was complete, I took a moment to pause and reconfigure a few things.  As I plan to partially expose the ownCloud instance to the Internet and have it accessible from my smartphone, one of my first goals/low hanging fruit items for protecting it from a large chunk of port scans, hacks, and exploits is to change the web service to run on a non-default port number.  I could simply do this externally, but then I would have to change my client settings whenever I was on my wifi connection.  So instead I referenced changing the port number in Apache.  I’ve done this a few times in the past, but I decided I would like to also maintain the ability to serve some pages on the standard HTTP port if I so decided later.  I edited /etc/apache2/ports.conf and added an entry for my non-SSL port directly below the “Listen 80” directive, and for my SSL ports within the <IfModule mod_ssl.c> and <IfModule mod_gnutls.c> sections below the “Listen 443” directives in each of those sections.  Rather than edit the “default” site file, I created a new site file at /etc/apache2/sites-available/owncloud, similar to the following.  The port numbers and DNS names referenced are purposefully invalid as I’m not trying to create a honeypot; modify them appropriately for your configuration.

        #unfortunately this isn't pasting correctly, so parts are missing.
        #Too late in the day for me to fix right now.
        ServerName owncloud.example.com
        DocumentRoot /var/www/owncloud
        ServerAdmin me@example.com

                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all

        #ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        #<Directory "/usr/lib/cgi-bin">
                #AllowOverride None
                #Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                #Order allow,deny
                #Allow from all
        #

        ErrorLog ${APACHE_LOG_DIR}/ownclouderror.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

In the future I will also be creating an owncloud-ssl file in the same directory. This will definitely happen before I configure any phone synchronization over the public Internet.  After restarting the apache service, I was able to access the ownCloud instance via http://owncloud_ip:newport#.  I have a bit of DNS work to do on my router to make the naming work universally, from the Internet or my LAN.  May document it up if there is any interest.  I would have to say this install was pretty slick and that I’m likely to pay for the client for my Android.

Older Posts »

Powered by WordPress