So, life intrudes, projects are delayed, but I'm back. This is an extension of my 20 year quest for Strong AI, itself an extension of my investigation of Natural Intelligence, and really only in the last 5 to 8 years have I been trying to organize the "silicon" to get it done right. Previously, I posted some interesting comments on a 6502 forum, back about 2014 or 2015. Those are worth reading, to understand the development of my thought on these topics.
Back in my "retro-6502" days (2014-2015), I was working on my plans for "robot eyes". Those are "still in the works", but, for today, and yesterday, and the next month or two, I will need to start organizing my "robot spinal cord". Namely, USB gadget-ize, 10 R-Pi zeros, and distribute the boards, physically, onto a titanium skeleton (11+ QTY. , 8 mm. diameter, one-foot sections; 8 for limbs; 3 for spine; + miscellaneous? ; motors, "muscles" and "joints" are "in the works"). Originally I was on a very shoestring budget and figured "run clean and light" and thus, picore, RAM-resident (saves money on micro-SDs), but I can probably afford the SD cards now. Still, I was glad to stumble on this old post, and to try to update it with my experience.
Also new to this project, is my dedicated, wall-plug power supply, with some 12 USB "ports" (receptacles), all of them dealing 1 Amp or more, up to 3.5 Amps for some "ports" (receptacles). So, plenty of power. Even if I USB gadgetize the 8 peripheral processors, "the limbs", I will leave them booted and powered from this power supply, and just use the USB gadget function to program--through a 10 "port" (receptacle) USB strip--from the master board to the slaves. Eventually, I will do the "Ohm's Law" math, and get it battery or maybe even solar powered.
I was not sure I knew how to do this; how to gadget-ize while leaving the power supply in place, or if there was some extra programming involved? As it might have been the case that plugging one r-pi zero (gadgetized) into another (non-gadget) would force the non-gadget to power the gadget. The master RPI zero cannot run 10 slave RPI zeros through its USB port; not enough amperage supply. But, luckily, this is not the case, as my USB volt-ammeter confirms. With a series of interesting little experiments I have gotten 2 Raspbian slaves to show up on the network of one Raspbian master, and crucially, they remain powered by my external power supply, not the R-PI zero master-board. I should probably try to see if two raspbian slaves will show up under (ifconfig) one picore master? I bet they would? I should try that today.
So, with the equipment above, and just ping, ifconfig, lsusb, lsblk, and a little bit of knowledge about IPs, I was able to get the 2 boards to show up under ifconfig, as "usb0" and "usb1", with assigned , dynamic IP (IPv4) addresses. I should probably study RNDIS, a bit, as I think that might be the "protocol" that assigns IPs to usb devices? I don't know? I had a few "USB books" by Jan Axelson, but they were too high level to interest me ( I like physics of ones and zeros; bare metal) and too low level to be practical to this project. The advice of johannkraus is JUST RIGHT. Nevermind the books. roll up your sleeves and DO IT!
It probably wouldn't hurt to reassign user-names, hostnames, and passwords, both for my Raspbian SD cards, masters and slaves, and for my piCore masters and slaves. That way IP addresses would be easier? I suppose I could also assign static IP addresses? I know how to do that, but I forgot. Also, with cat /proc/cpuinfo I can take notes on the serial numbers of each device, so that my scientific experiment is more rigorous (meticulous notation!).
Anyhoo, so, last night I stumbled on this post again, and saw--now, with my two years experience in linux CLI--that johannkraus provided excellent instructions; albeit, a bit cross purpose to my own. But his knowledge of rpis and adding modules and of tiny core persistence has helped me, quite a bit, to organize my thoughts and move my programming actions in a positive direction (instead of continued 2 year stagnation).
So last night I (1) found and downloaded modules, (2) unzipped and placed on a flash drive, { (2b) removed flash drive from laptop; booted rpi zero with not-yet-gadget-ized picore 9.0.? ; and plugged flash drive into the rpi zero } ;(3) navigated the CLI of picore (I have v. 9 and v. 11 picore; but no desktop, as of yet) to place the relevant modules in /lib/.../usb , as johannkraus indicated, (4) ran his depmod -a command, even though I don't know what it does, (5) updated .filetool.lst and ran backup, (6) added /sbin/modprobe dwc2 to the onboot.lst , even though I dont know what that does. Presumably, on boot, something "new" will happen?
And then I got tired and fell asleep.
I see, this morning, that I did forget to get the file modules.dep . I wonder if it is a necessary one?
I suppose I should just try plugging the microSD into my laptop, edit the cmdline.txt (or was it cmdline.txt ?) to include dtoverlay=dwc2, and then eject, and then go boot a pi or two, to see if one will be master and one slave? See if ifconfig comes up with more than just a loopback address? comes up with a "usb0" readings; and an IPv4 inet address for it? I could ping it, just for fun!
I also ignored johannkraus' steps about g_multi , since I think this is needed for his mass storage device, whereas, I need g_ether, for my device.
I kinda wish I knew what he meant by this :
"For a working ether over usb I just set up the usb0 interface via ifconfig as described elsewhere in this forum for static eth0."
Any ideas? Anybody? Suggestions?
I think I recall somebody posting (above, somewhere?) that the raspbian instructions to add to cmdline.txt "modules-load=dwc2,g_ether" command doesn't work with picore? hmmm? I'll think about it? Try it?
I have some more steps to figure out this morning, and still have to follow the rest of the thread. Somebody else had trouble getting g_ether to work, but eventual with johannkraus' help--and some perseverence and elbow grease--they got it going.