Jump to content
vikipha

PcDuino3 as TV media center

Recommended Posts

Thank you cwilt. 

 

You are being very patient with an old man. 

Because the superblock error only happens in the middle of the make mmc boot process, I am guessing that you mean I should run the sudo fsck.ext4 -v /dev/xxx  on the microSd after I format it as FAT32, but before I insert it into the pcDuino to use board-config.

 

I will start again formatting one of the SDcards as FAT32 and sudo fsck.fat32 -v /dev/sdb  

 

Then:  

sudo mke2fs -n /dev/xx     I guess for me it will be      sudo mke2fs -n /dev/sdb

 

Then: 

sudo e2fsck -b first_block_number /dev/xxx  using the block number in the previous command.

 

After that i will shove the SD in the pcDuino and try again with board-config.

 

I still don;t understand why for some people using exactly the same brand new unused microSDcard, board-config Works.

 

Thanks again.  I hope all this eventually helps someone else who has this problem..

Share this post


Link to post
Share on other sites

UPDATE:  Using fsck on the FAt32 formatted disk shows no errors at all. 

But I still get the bad superblock error as soon as the fat16 boot partition is created and formated, but before it has finished formating the ext3 partiton on the SD.

 

So I end up with an SD with 3 files in about 6MB of fat16 partiton, and an empty 3.5GB ext3 partition that I can run the fsck thing on again.

 

And I get:

ross@ross-CQ1040AN-b:~$ sudo fsck.ext3 -v /dev/sdb2
[sudo] password for ross:
e2fsck 1.42.9 (4-Feb-2014)
/dev/sdb2: recovering journal
Setting free inodes count to 130345 (was 130404)
Setting free blocks count to 327816 (was 328509)
/dev/sdb2: clean, 98407/228752 files, 591736/919552 blocks
ross@ross-CQ1040AN-b:~$
 

And for the fat16:

ross@ross-CQ1040AN-b:~$ sudo fsck.vfat -v /dev/sdb1
fsck.fat 3.0.26 (2014-03-07)
fsck.fat 3.0.26 (2014-03-07)
Checking we can access the last sector of the filesystem
Boot sector contents:
System ID "mkdosfs"
Media byte 0xf8 (hard disk)
       512 bytes per logical sector
      2048 bytes per cluster
         4 reserved sectors
First FAT starts at byte 2048 (sector 4)
         2 FATs, 16 bit entries
     16384 bytes per FAT (= 32 sectors)
Root directory starts at byte 34816 (sector 68)
       512 root directory entries
Data area starts at byte 51200 (sector 100)
      8167 data clusters (16726016 bytes)
16 sectors/track, 4 heads
         0 hidden sectors
     32768 sectors total
Checking for unused clusters.
/dev/sdb1: 3 files, 3198/8167 clusters
ross@ross-CQ1040AN-b:~$
 

So now I have an SD with the usual 3 files in the FAt16 partiton and an empty 3.5GB ext3 partition with no apparent errors and no way to get the files onto it.

 

NEXT COMMAND on sdb1:

 

ross@ross-CQ1040AN-b:~$ sudo mke2fs -n /dev/sdb1
mke2fs 1.42.9 (4-Feb-2014)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
4096 inodes, 16384 blocks
819 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=16777216
2 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks:
        8193
 

THEN ON sdb2

 

ross@ross-CQ1040AN-b:~$ sudo mke2fs -n /dev/sdb2
mke2fs 1.42.9 (4-Feb-2014)
Could not stat /dev/sdb2 --- No such file or directory

The device apparently does not exist; did you specify it correctly?
ross@ross-CQ1040AN-b:~$
 

So I try the superblock backup as suggested:

 

The device apparently does not exist; did you specify it correctly?
ross@ross-CQ1040AN-b:~$ sudo e2fsck -b 8193 /dev/sdb2
e2fsck 1.42.9 (4-Feb-2014)
e2fsck: No such file or directory while trying to open /dev/sdb2
Possibly non-existent device?
ross@ross-CQ1040AN-b:~$
 

Which brings me back to where I began a couple of days ago.

 

Stillopen to suggestions.  I now have one 32GB sd card and one 16GB sd card with a FAT16 partiton on each with 3 files in about 6MB, and a 3.5GB partition on each that apparently doesn;t exist, and one 32GB sd card that is bootable, but has no wicd or other network manager ,and no way to install networking with apt-get, because there is no network access without it!

 

 

Any more suggestions?  I'm giving up shortly and heading for bed.

Share this post


Link to post
Share on other sites

Thank you.  I couldn't get to sleep,so I continued working on the problem until 4am.  I decided since I had somehow made one 32GB card that worked except for not having any network stuff at all, and because there is no way to download the network manager to another computer then copy it to the card that does boot card and install it - I would try something else.

 

So I tried copying the entire /ubuntu across from root on the pcDuno to /home on the bootable SD that had no networking.  That didn't work either.

 

I decided since that card actually boots into the OS and shows the correct partition sizes in File Manager, I would simply run board-congif again to try to make a bootable mmc with evrything on it again.

 

And got stuck with the same error about Error message about wrong fs type, bad option, bad superblock etc.

 

Once it finished and said it succeeded I tried booting.  Now I have a previously bootable card telling me:

No valid rootfs found.  try to update from udisk and sdcard
please insert the disk or sdcard with update.sh and image file
The flashing on and off below those lines:
searching for update.sh from usb disk
searching update.sh from sdcard

 

 

So back to 3 perfectly good micro SD cards that pcDuino keeps killing  :-)

 

In the end I used the backup option to backup the system to the last microSD, and it went through creating the partitions and formatting the card without  hitch.

 

So now what used to be my accidentally bootable SD with no networking, but otherwise fine, has a 16MB partition with a lost+fond folder root cannot get into or copy, plus these files:   nanda.img (32MB),  nandb.img (16MB with 9.7MB free)  and nandd.img (3.5GB with 1.11GB free)

 

GParted shows FAT16 (16MB),  ext3 (3.77GB)  and unallocated space (24.82GB)

 

If all else fails I 'might' be able to use GParted to partition pne of the cards to FAT16 and ext3, resize the ext3 touse the unallocated space, then use dd to write nandb.img to the FAT16 partition, then use dd to write nandd.img to the ext3 partition. set the FAT16 flag to boot and see what that does.

 

Thoughts on that idea?   If my brain was still a able to function as a programmer / tech / problem solver, that is where I would be going next, Unfortunately I know nothing about the way the pcDuino and A20 architecture work together and I'm not quite bright enough any more to learn.

Share this post


Link to post
Share on other sites

Just got your last post.

 

I have been trying to create the bootable SD from the pcDuino.  Just using the Linux PC to reformat the SD cards so I could use board-config on them again from the pcDuino.

 

Then I tried on the PC using the dd command (mentioned in one of the earlier posts when you asked what image I used with dd.

 

But as you see from the post above - when all else failed I tried copying files across from root on the pcDuino to partitions on the mmcSD that pcDuino had created.

 

That failed so in the last couple of lines of my last post you can see I'm now considering manually trying to create partitions with the Linux PC and copy over the files I have backed up from the 'backup to mmc' process on board-config.

 

I'm not sure if you are finding this problem to be a challenge or an annoyance.  I'm stuck at the 'challenge' part at the moment.   The pcDuino works perfectly well without booting from SD, but when I managed to get it working the boot speed is incredibly fast, and had networking operated I woould have had exactly what I wanted, with room to install other software and save documents and media prior to moviing them elsewhere.

 

If it is impossible to make a bootable SD I'll live with it - but if others can do it, i see no reason why it doesn;t simply work.  Unless there's something corrupted in pcDuino when I ran the update all process.

Share this post


Link to post
Share on other sites

ok, I've made a folder in the FAT16 partition and copied restore.sh. restore_tty1.sh, restore_ttys0.sh and update.sh into that folder, leaving me with script.bin, uEnv.txt and uimage (the 3 files usually in that partition)

I have set the boot flag on the FAt16 partition

 

Now i am formatting the ext3 partition again and will resize it to take up the unallocated space then try to use dd to set up nandd in there.

 

Can't do any worse than before.  If it doensn't boot I will ask about the risks of pulling the update.sh out of the folder and trying with that active.  but that could brick the pcDuino   :-(   so I have avoided it.

 

EDIT:

Before I consider messing with update.sh if the above fails I will reformat the partitions and aligh with cylinder instead of align with MIB.  Just in case the architecture of the pcDuino prefers the old methods of addressing blocks and sectors.  But I'm getting into stuff I barely remember now.

 

EDIT:

That almost did something.  but it seems the partition might need to be resized after the dd command.  I ended up with 1.8GB written then it ran out of space on the supposedly 28GB ext3.

Doing the backup thing again now.  The will move the filess for reflashing to a spare folder and try doing the dd thing on the ext3 before resizing.

 

EDIT:

Ok, writing the backup to the ext3 partition failed with the same error as writign it to a resized partition.

umount: /dev/sdb2: not mounted
ross@ross-CQ1040AN-b:~/SOFTWARE-Downloaded/z pcDuino Stuff/0-backup od entire system of pcDuino at 2015-July-29/4.9GB-partition$ sudo dd if=nandd.img of=/dev/sdb2 bs=1M
dd: error writing ‘/dev/sdb2’: No space left on device
1807+0 records in
1806+0 records out
1893826560 bytes (1.9 GB) copied, 23.5528 s, 80.4 MB/s
ross@ross-CQ1040AN-b:~/SOFTWARE-Downloaded/z pcDuino Stuff/0-backup od entire system of pcDuino at 2015-July-29/4.9GB-partition$

 

BUT - - -   I did manage to get the wrong fstype, bad option. bad superblock error again when I tried to access it in my file manager:

 

An error occurred while accessing '4.9 GiB Removable Media', the system responded: The requested operation has failed: Error mounting /dev/sdb2 at /media/ross/d4b31417-9a79-46b0-89e1-12e0d605ce64: Command-line `mount -t "ext3" -o "uhelper=udisks2,nodev,nosuid" "/dev/sdb2" "/media/ross/d4b31417-9a79-46b0-89e1-12e0d605ce64"' exited with non-zero exit status 32: mount: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so

 

I'm about out of ideas now. So I'll give up and wait for suggestions :-)

 

 

 

Share this post


Link to post
Share on other sites

The pcDuino v3B came with ubuntu preinstalled, as they all do here in Australia.  I don't know what happens overseas.

All I did initially was follow the instructions, which involved doing the 'update all' thing in board-config, before trying to make mmc boot.

 

However I just formatted one card again but this time aligned to Cylinder instead of MiB when I formatted.  It still didn;t work and there's a network error i don't remember from before, but I didn;t watch that part of the screen closely.

 

What I did this time however was copy the process from terminal including the dmesg | tail output.  This is from using board-config on the pcDuino to run updare all, then rebooting and using board-config to run make mmc boot on a freshly formatted FAT32 card.

 

Here it is:

 

Running make mmc boot messages:
SIOCSIFADDR: No such device
usb0: ERROR while getting interface flags: No such device
usb0: ERROR while getting interface flags: No such device
Internet Systems Consortium DHCP Server 4.1-ESV-R4
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Wrote 0 leases to leases file.

No subnet declaration for wlan5 (192.168.0.139).
** Ignoring requests on wlan5.  If this is not what
   you want, please write a subnet declaration
   in your dhcpd.conf file for the network segment
   to which interface wlan5 is attached. **


Not configured to listen on any interfaces!
/usr/bin/board-config.sh: line 295: [: !=: unary operator expected
making partitions on /dev/mmcblk0...    [done]
/dev/mmcblk0p1 formating...    [done]
/dev/mmcblk0p2 formating...    [done]
The error messageabout wrong fstype and bad stuff etc.  pops up HERE  !!!!
Then thiings seem to continue...
copying nandd to sdcard, will take abount 10 minutes...


Result of dmesg | tail after the 'succeed' screen pops up:

ubuntu@ubuntu:~$ dmesg | tail
dmesg: klogctl failed: Operation not permitted
ubuntu@ubuntu:~$ dmesg | so
bash: so: command not found
dmesg: klogctl failed: Operation not permitted
ubuntu@ubuntu:~$ sudo dmsg | tail
sudo: dmsg: command not found
ubuntu@ubuntu:~$ sudo dmesg | tail
[  371.292156] [mmc-msg] sdc0 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B
[  371.292186] mmc0: new high speed SDHC card at address aaaa
[  371.292815] mmcblk0: mmc0:aaaa SU32G 29.7 GiB
[  371.297644]  mmcblk0: p1 p2
[  372.814816] kjournald starting.  Commit interval 5 seconds
[  372.816658] EXT3-fs (mmcblk0p2): using internal journal
[  372.816676] EXT3-fs (mmcblk0p2): mounted filesystem with ordered data mode
[  389.348558]  mmcblk0: p1 p2
[  431.680533] JBD: no valid journal superblock found
[  431.680569] EXT3-fs (mmcblk0p2): error loading journal
ubuntu@ubuntu:~$
 

 

BTW, my blood pressure is now stable again after all this.  It has settled nicely at  165 / 89.   I love computers!!!

Maybe that stuff from dmesg will give you some ideas.  I should have remembered to post it earlier.

Share this post


Link to post
Share on other sites

It seems that this is a bug in some older releases. Loading a newer release onto the nand should fix this issue.

 

If there are further questions or problems start a new discussion please.

Share this post


Link to post
Share on other sites

aha.  Thank you.  Before we close off this post, can you please let me know 'which' newer release is compatible and can be installed using the resources I have. 

 

Linux PC to download the appropriate image - but it will need to be recent enough and NOT need tools like PhoenixCard or the other Windows stuff.

 

Micro SD  (my preferred method if it is possible since I have modified the USB port configuration  to run the external 1TB hard drives)

USB thumb drive - my least preferred option for the above reason. 

Once I know which files to download I can try flashing the thing.

 

Thanks again for the time you spent discovering this.

 

RossD.

Share this post


Link to post
Share on other sites

Thank you for your help and ideas.  I think we can close the thread BUT I've seen other things on google where this problem has not been resolved.  So I think that you have discovered the cause and solution is magic.

 

I'll work through those links.  I suppose I will have to convert the dbug microUSB again for debug again to flash nand.  :-(  But it will be worthwhile and I have sunxi tools now anyway.

 

Only reason I can see for doing all this is to be able to install say multimedia programs on one SD, and iin my case graphics stuff on another and have an emergency backup.

 

I could simply swap cards to completely change the pcDuino from a multimedia system to a working computer.  I already discovered it converts video files from avi to mp4 in about the same time as my desktop.  Just doesn't have room to do a good sized one.

 

Plus the one card that did boot for a while booted up light lightning compared to the boot from nand.

 

Appreciated heaps.

 

Cheers,

 

RossD.

Share this post


Link to post
Share on other sites

WORKING bootable 32GB microSD at last!!

 

It seems trying to use board-config.sh on my particular pcDuino was doing something weird to each new microSD card.

So I ended up with cards I could format and write data to, but not set bootable.  I ended up doing the following with a card, then used the dd command to write the bootable pcDuino image.  Then I opened it in GParted and set the fat16 partiton flag to 'boot' yet again, and tested it.

 

And it worked.  I read loads of posts about fixing a dead MBR, but only one seemed simple, so I used that.  Here it is, for anyone else who has a dead MBR on a removable drive.  Use With Extreme caution, as with any command line dixk repair stuff.

 

Fixing the Master Boot Record:

Be REALLY REALLY careful that you know what drive you are installing an MBR to !!

This worked for me on the micro SD cards I was trying to use to make a bootable 32GB SD
because there seems to be a problem in 'some' of the board-config.sh before a certain date,
and the dd command left me with bad superblock errors as discussed earlier.

First there is a small program to install to create the new mbr on the USB flash drive

    Open a terminal and type sudo su
    Type apt-get install mbr
    Type fdisk -l to find out which device is your flash drive
    Type install-mbr /dev/sdx (replacing x with your flash device)

 

If the card boots in the pcDuino, simply resize sdx2 form about 1.8GB to take up the rest of the unused space.  I put the card back in my Linux PC and used GParted.

 

In my case on my Linux Ubuntu PC the removable SD card slot somes up as sdb  and the ordinary USB flash drives are sdf

Yours could be something else.  Find Out for sure BEFORE you run the mbr utility.  GParted will give you a pretty good idea what they are called.

 

Hopefully this will help you get a not so cooperative flash drive to boot.

 

Thanks to cwilt for all the help.

Share this post


Link to post
Share on other sites

I'm still finding video is a bit strange using PCDuino 3B and Linux for multimedia.  However, there's a product I just saw that might be unteresting for Aussies messing with PCduino as a multimedia centre and it should work using Android.

 

It is a $199 2.4Ghz HDMI wireless setup.  So I imagine you could plug the transmitter into the PCDuino, and plug the receiver into your TV, then use the thing from wherever you happen to be,  I can think of other uses for this thing too.  But an interesting part is that both the transmitter and receiver apparently run off 5 Volts DC at only 180mA.   That probably opens it up to something like powering the transmitter directly from the PCDuino 3B on board SATA power connection.

 

Just a thought.

 

http://www.jaycar.com.au/p/AR1871?utm_source=AR1871&utm_medium=Email&utm_campaign=CFNovember15au

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×