Old Beaglebone Black instalation upgrade

Hi everyone,

I have a few questions about an old 3D printer (Type A Machines Series1) that runs Octoprint on a Beaglebone Black as the only interface.

All software installations date back to 2015 and since the company closed down on 2017 I’m kinda stuck at them to keep thing running.

My main goal is to update the software components in a fresh new installation, but I need to have a backup scenario that I can quickly reverse to if things go bad or if I need to use the printer in the meantime.

I’m a really begginer into linux and also on single board computers (BBB and RPi), but I don’t think things are that hard to give it a try. I’m also not 100% sure about the current scenario on the BBB, but I have made a little research and got some information, maybe someone can help me figure thing out.

Type A Machines have left the repositories accessible HERE, so I could dig into it and found the user/password to SSH into the BBB.

Here are a few data collected:

lsb_release - a
  No LSB modules are available.
  Distributor ID: Debian
  Description:    Debian GNU/Linux 8.1 (jessie)
  Release:        8.1
  Codename:       jessie

uname -r
  3.8.13-bone71

cat /etc/dogtag
  Type A Series 1 Debian jessie 2015-07-27

df -h
  Filesystem      Size  Used Avail Use% Mounted on
  /dev/mmcblk0p2  7.2G  1.4G  5.5G  20% /
  udev             10M     0   10M   0% /dev
  tmpfs           100M  8.5M   91M   9% /run
  tmpfs           249M     0  249M   0% /dev/shm
  tmpfs           5.0M     0  5.0M   0% /run/lock
  tmpfs           249M     0  249M   0% /sys/fs/cgroup

lsblk
  NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
  mmcblk1boot0 179:16   0    2M  1 disk
  mmcblk1boot1 179:24   0    2M  1 disk
  mmcblk0      179:0    0  7.4G  0 disk
  |-mmcblk0p1  179:1    0   96M  0 part
  `-mmcblk0p2  179:2    0  7.3G  0 part /
  mmcblk1      179:8    0  3.6G  0 disk
  |-mmcblk1p1  179:9    0   96M  0 part
  `-mmcblk1p2  179:10   0  3.5G  0 part

sudo fdisk -l
  Disk /dev/mmcblk0: 7.4 GiB, 7948206080 bytes, 15523840 sectors
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disklabel type: dos
  Disk identifier: 0x00000000
  
  Device         Boot  Start      End  Sectors  Size Id Type
  /dev/mmcblk0p1 *      2048   198655   196608   96M  e W95 FAT16 (LBA)
  /dev/mmcblk0p2      198656 15523839 15325184  7.3G 83 Linux
  
  Disk /dev/mmcblk1: 3.6 GiB, 3867148288 bytes, 7553024 sectors
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disklabel type: dos
  Disk identifier: 0x00000000
  
  Device         Boot  Start     End Sectors  Size Id Type
  /dev/mmcblk1p1 *      2048  198655  196608   96M  e W95 FAT16 (LBA)
  /dev/mmcblk1p2      198656 7553023 7354368  3.5G 83 Linux
  
  Disk /dev/mmcblk1boot1: 2 MiB, 2097152 bytes, 4096 sectors
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disk /dev/mmcblk1boot0: 2 MiB, 2097152 bytes, 4096 sectors
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes

In addition to that, I powered down the printer, removed the sd card and powered it back on. Wasn’t able to access anything. Put the sd card back in and had some trouble to make it work again (I’m not sure what I did, but I think I held Boot button, pressed Power button, then after some time released boot button).

From all that information It seems everithing is always running from the sd card. (I dont need to make any button presses on normal operation. The printer always boot ok after each power cicle).

If that is correct I have two options:

1 - create a copy of the current SD card and mess with it to update a few packages; or
2 - create a fresh new image with all thing updated

either case, I want to revert things back, if needed, just plugging back the old sd card.

What do you guys recommend?

From your df command above, it appears to be an 8G filesystem, the board has 4 (or2) GB of onboard flash, so you’re definitely running from the sd card.

It seems the most important thing here is safety - you need to be able to always revert to a known-working state. With that in mind, first thing to to would be to create an *.img file of your working sd card. If it were me, I’d then flash that to a new sd card, test it to make sure it really is good, then put the original somewhere safe. Next make a 2nd copy of the sd card and use that to boot the machine, then just run apt update and apt upgrade then check it’s all still working properly. The upgrade may have broken it, if so, you can revert to your copy of the original sd card while you figure out what needs to be fixed.

If it’s all good, then flash another sd card with a modern debian image. You’ll then need to figure out what needs to be rebuilt and/or installed from the old A Machines repository. If this becomes too hard, try earlier debian versions untill you have some success.

But the question is - what are you trying to achieve? You may be better to simply stick to what works. ('Tho make sure you do make a backup .img file of the working sdcard).

1 Like

Thanks, paul!

first, why bother?

My printer doesn’t have a heated bed, nor bed levelling. I’m in the process of building those parts and updating the control board firmware to work with those new features.

Type A Machines have made a personalized version of Octoprint, onto wich I don’t have the heated bed status/control, I also can’t install any desired plugins (there are MANY available) to get new cool features.

I’m worried that I can’t apt update/upgrade this particular package on my BBB, so I will probably remove the Type A Machines one and install an official one. At this point I’m diverting from the original build setup and may face some problems, hence the need to have the safe “snapshot” point.

Future plans are to get rid of my Marlin Firmware on the control board and install Klipper. This way I’ll get full 32bit computational power of the beagle bone to run advance kinematics calculations (Input Shaping and Linear Advance) to get faster prints with more quality, wich are a no go on my current AVR 8bit control board.

I’m with you on that, but why it always boot from the SD card at every power cycle? I can see the eMMc partition there, so I believe they didn’t erased the partition as people have suggested around as a form to always boot from the sd card.

Can I get any help on this? What should do/look for? Do I need a dedicated Linux machine?
I do have a windows 11 laptop with sd card reader. should I create a linux virtual machine?

Any help will be highly appreciated!

You might be better of buying an out of the box solution for your hardware.

Your original source code is so stale its not worth the time to bring it up to current. Pretty sure BBB has those older images available, that is your only option then clone your SD card and find the correct version of UBoot for that image to install on your new board.

To clone the card to a .img file on your windows laptop, you could use the linux dd command from WSL. On linux, the command would be of the form:
dd if=/dev/mmcblkX of=/path/filename.img bs=1M
Where if is the source device. I’m not sure what this name would be under WSL.

Apparently, you can also use the windows utility win32diskimager, although I havnt tried it. Balena Etcher can apparently clone a card to another card but cannot save a .img file.
Otherwise try a google search - there are a number of tools out there to write an .img file to an sd card, some could undoubtably read the card and save it as a file as well.

That worked great, Paul! got the img file, burned a brand new SD card, wich is already running on the printer and everything seems fine. As you suggested before, I’ll keep the original SD card safe and store the IMG file on the cloud as a backup.

Now I’'l start to poke around, learn a lot, try many things and hopefully get somewhere (better).

The first thing, thou, my original SD card was 8gb and my new one is 16GB, so the partitions created by the img file are 8GB only, how can I expand the linux partition on the BBB?

@guischall

reboot. sudo shutdown -r now

That should inflate the max capacity of the micro SD Card.

Seth

P.S. That is for newer images. The older image from Jessie used a script that was not used on the reboot to inflate the micro SD Card to its full capacity.

As an alternative, you could create a new partition in the 8G space. Call it /data (or call it whatever you like). Personally, I like separate partitions for work. Use fdisk on the BBB for this.

To grow a partition, the process is to delete the partition, create a new bigger one in it’s place then grow the filesystem to fill the partition. There are any number of tools available to do this but if you dont have a separate linux machine, this needs to be done on the BBB on the running filesystem, which complicates things. The simplest way is to use fdisk to delete and recreate the partition, then resize2fs to grow the filesystem. Since you’re using a new sdcard that you can easily re-flash if it all turns to custard, this is a good enough option.
There are scripts that can do this for you, Seth suggested a process that utilises this in his reply, but I cant point you to an actual script.

1 Like

@bbbpaul ,

I think it was /opt/scripts/tools/grow_partition.sh that did it.

That was in the days of Jessie, I think.

I have not used Jessie in a long time. Update!

Seth