Octopi Static IP - restoring original .txt file config functionality

What is the problem?

I've been stuck using very old versions of Octoprint due to the way network config changed being detrimental to my ideal setup. This works, nothing is broken, but I want to update.

I have around 50 printers/CNC to manage, across several locations - my business' bureau service printers, R&D machines, my personal machines and printers belonging to customers.
At any time any of them can move between locations, so I have networking carefully set up to be identical at each site, with a whole subnet dedicated to Octopi devices.
The only way to manage the inventory stay sane is to:

  1. use static IP addresses for each Pi
  2. have the Pi itself force the static IP NOT the router.
  3. Be able to easily re-deploy new SD card images separately from the Pi and without having to locate it on the network.

What did you already try to solve it?

I've reviewed multiple how-tos and it seems like since octopi-network.txt was deprecated, there has been a philosophy change - maybe forced by changes to Raspbian/Pi OS - and now the 'right' place to change it on the Pi is from within the Linux filesystem. I've done this before and it's not a big deal for ONE pi.
But if I have 16 to update as I currently do? Nightmare.
For every one I appear to have to write a new SD image, put it in the Pi, FIND the dynamically allocated IP on my (local) router, PuTTY into it, navigate to the relevant config file, edit it in Vi and shut down.

This is WAY harder than:

  1. burn the same SD image to 16 SD cards on my desktop PC
  2. change 2 digits in a text file to match what's written on the SD card
  3. put the SDs back in the Pis on the printers with the same numbers
  4. Enjoy a beer and a TV programme in the time I saved compared to current!

Have you tried running in safe mode?

N/A

Complete Logs

N/A

Additional information about your setup

CURRENT: OctoPrint 1.3.6 running on OctoPi 0.14.0, Raspberry Pi 0,1,2,3 & 4!
DESIRED: Latest Octoprint/Octopi into the future.

So this is not a moan, I propose to try to solve this in this way, and I'm seeking only constructive advice to achieve the goal I've stated:

  1. De-confuse myself regarding the current way people are setting a static IP - ideally both wired and wireless
  2. Filter and ignore ALL advice to 'just assign an IP on the Router' or similar
  3. Try to understand how octopi-network worked originally, and re-create this - which to me means creating a file in the Windows-readable 30mb partition, and setting up the linux system config file to read it to obtain its IP config info.
  4. resume my original process for redeploying Octopi

Has this already been done?
Is there a reason this CAN'T work? (IE forcing octopi-network.txt to be deprecated)?
Can anyone point me to how best to get the Linux config files to read a .txt file and grab the new details?

Thanks in advance for any info TOWARDS this goal not away from it!!!

Holy wow, that is old. Ok there must be something you can do here, let's think.

To access the Linux filesystem, you could use a Linux based OS to configure it?

This article shows that this can all be configured using /etc/dhcpcd.conf - this might be what you have done before:
TCP/IP networking - Raspberry Pi Documentation

To resume your 'just change a couple of lines in a text file', you could:

  1. Setup one machine on a Linux system (even OctoPi will do, use what you have available),
  2. Plug the new SD card in using USB
  3. Change /etc/dhcpcd.conf on the new card, flashed with OctoPi.

That sounds like a less-effort solution to me. If you really want to speed up the process and not have to configure the whole file (uncommenting all the relevant options) get yourself a copy of the file that is correct, then copy it across changing 2 characters each time.

1 Like

Thanks for a fully on-topic response and I like the suggestion!

Yep, it's old, but still perfectly functional and 'just works' so not broken, but I really want to update and use some current plugins across the fleet, which I currently only have on a couple of more up to date printers.

So you suggest I use a Linux computer which CAN read the EXT filesystem, and then I can do pretty much what I used to do - duplicate a bunch of SD cards and then just go in and edit that one file. Nice.

I've no fear of Linux but I want to be able to do this at multiple locations and Windows PCs are the easy go-to in all of them -so I would still like to try to regain the original functionality of octoprint-network.txt, but this is a close second.

I'm checking out ways to mount the EXT4 partition under Windows too...

octopi-network.txt was before my time around here, so I don't actually know how that used to work, my guess (based on rough history knowledge) is that it went like this:

  • OctoPi implements headless nework config, using octopi-network.txt
  • Raspbian implements headless network config later down the road, using a different system
  • Hence no reason to try and maintain OctoPi's system down the road, as the Debian image was upgraded and just use the existing system. (is 0.14... Jessie? Might have been Jessie knowing the rough timeline (I was using RPi before OctoPrint)

Now you could post a feature request for OctoPi to allow for configuring /etc/dhcpcd.conf from the boot partition, so you can see it on everything. However:

  • This might take a while - there's a new OctoPi image in testing for release within a month, no more changes there
  • Guy is exploring a switch to Ubuntu - which might mean completely different setup, unsure yet
  • Potentially, no one else has the time/effort/desire/knowledge etc. to implement it, so it never gets done.

You probably want a solution in the not so distant future. Maybe it is as simple as setting up a link or auto-copy on boot from /boot to the right place. I don't know.

1 Like

Another good suggestion! A nice dirty shell script to copy-paste is within Linux skills I have at least at some point possessed! Will try it...

1 Like

OK! This seems to work very well, tried it on 3 Pis without issue :slight_smile:

Method:
Write a fresh Octopi image to a new SD card, stick in a wired networked Pi, turn on.
By checking on router, obtain IP address of new Pi, as allocated via DHCP.
Putty into new Pi and log in, Pi, Raspberry

Type this command:
sudo cp /etc/dhcpcd.conf /boot/son-of-octopi-network.txt

[enter], raspberry, [enter]

Type this command:
sudo crontab –e

[enter], [enter]

Cursor down to after the lines beginning with # and type:

@reboot cp /boot/son-of-octopi-network.txt /etc/dhcpcd.conf

Ctrl-o

[enter]

Ctrl-x

Logout [enter]

Now, the SD card can be removed from the Pi and duplicated.
For each new Pi, make the same edits to son-of-octopi-network.txt that you would in dhcpcd.conf to set the IP details.needed.

This seems to be a simple solution to my problem and gets me back to where I was with octopi-network.txt - I will play around some more and see if I can do a more sophisticated version, but this simple methods should stand up to future changes at least.

Thanks very much for sharing ideas!

1 Like