On Saturday 13 May 2017 20:11:43 Tim wrote:

> > Gene wrote
[...]
> pi@navio:~ $ uname -r
> 4.4.9-rt17-v7+
> pi@navio:~ $
>
I have this kernel all unpacked.

> So it is a realtime kernel
> The way I come up with sdcard image is as follows.
> I started with a headless sdcard image from Emlid and built from there

Never heard of this one, and don't intend to run headless.
>
> Follow these direction in order to make a minamal Raspbian "Debian
> Jessie" install with a realtime kernel,(ver. 4.4.9-rt17) and Mate
> Desktop and Linuxcnc sdcard will work with rpi2 or 3
>
> # Download, extract then install Emlid image to sdcard download at
> https://files.emlid.com/images/emlid-raspbian-20160718.img.xz
>
> # On Linux computer download Etcher to write image to sdcard at
> https://etcher.io/

Roadblock, only for linux, mac or winders, yet you are saying to install 
it on the pi?
>
> Download, extract and run Etcher with administrator rights
> Select the archive file with image and sd card drive letter.
> Click “Flash!”. The process may take a few minutes.

What I have done so far is, on a 32Gb sandisk class 10, used dd to write 
the whole 2017-04-10-raspbian-jessie.img to it, took about 45 minutes.
edited /boot/config.txt so my monitor worked, booted the pi with it, 
expanded the / filesystem. Unplugged the pi, brought the card back to 
this machine and fixed the networking stuff.  Back to the pi with the 
card, booted, had a network, changed both passwords and had apt install 
synaptic and geany. ran synaptic, added the linuxcnc repo, updated and 
installed that. booted ok but of course linuxcnc failed as that is not a 
realtime kernel.

So now the card is back in the card reader, and I'm trying to install
kernel-4.4.9-rt17.  However, the card is about to upchuck I think, the 
copying of the kernel and kernel7 files is ssllooooowwwwwww, as in the 
latter is going in at nominally 4 kilobytes/second. But at least its 
moving. Says it will be done in another 5 minutes or so.

Then went to the lib and copied firmware and modules over.  That went a 
bit faster, half a meg a second.

Took the card back to the pi, plugged it in and plugged in the pi. Booted 
right up, showed the newly installed rt kernel when queried by uname.  
Plugged a usb hard drive into a usb port, dmesg says its sda1.  Asked 
for a blkid, got the two partitions of the sd card and the prompt back, 
but pi was frozen. Rebooted the pi with the power plug, then had apt 
install htop, tried to run linuxcnc, get exact same error as before. 
full screened the LXterminal and sudo -i, then ran htop, if it freezes 
again, maybe I'll have the culprit at the top of the list, maybe.

So the question still remains, and we've traced the src code to the exact 
line reporting this error, why is it receiveing "HOST" from the card 
when its got to be "7i90".  Any bit flipped in the fpga, and it will not 
init, but will flash the leds to indicate a bad load. They don't flash, 
only the ok led shines.

  If I manage to find the right place for my chew (if I did) it will 
work, and work for days at a time.

Communication using the hm2_rpspi.so driver is in 32 bit words in bursts 
4 bytes of 8 bits. I can sometimes scope the data lines, but the scope 
probes (10x probes to a gigahertz sampler) adversely affect the data 
integrity, making for com errors that show as machine errors.  Like a 
motor with no power applied suddenly moved half a mile?  Its running a 
11x36 lathe, a 65 yo sheldon, now without a compound and with ball 
screws for at least 10x the repeatable accuracy it had when it shipped 
in the '50's. Good. solidly built machine.  And its froze just sitting 
there, again, I can't ssh into it. Go see what htop is showing. Nothing, 
it was something in ssh this time, its keyboard was fairly normal.

Blow by blow below...

> ----------------------------------------------------------------------
>
> # RT-PREEMPT realtime kernel
> # Download kernel image
>
> http://download.frank-durr.de/kernel-4.4.9-rt17.tgz
>
I am running it now.

> # Extract files
> # Start your file manager from terminal with root privliges, my file
> manager is thunar so I use: # sudo thunar
> # Copy extracted files inside boot directory, to boot directory on
> sdcard choose to overwrite files # Copy extarcted file lib, to root of
> other partition on sdcard choose to overwrite files
>
> ----------------------------------------------------------------------
>-
>
> # Install Sdcard into PI
>
> user = pi
> password = raspberry
>
> # Connect to wired network
> # Or shh from another computers ethernet connection
>
> ----------------------------------------------------------------------
>--
>
> # See posts at this site about rt patched kernel on pi2 & 3 freezing
> during wifi use
> https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=159170
>
> # Need to add to end of cmdline.txt
>
> sudo nano /boot/cmdline.txt
>
> #Add the following
>
> dwc_otg.fiq_fsm_enable=0 dwc_otg.fiq_enable=0 dwc_otg.nak_holdoff=0
>
Not done yet, thanks. But I've always put that at the head of the line, 
does it matter?

> sudo reboot -n

Doing it now.

> # Update to correct keyboard layout
>
> sudo dpkg-reconfigure keyboard-configuration
>
Got that

> # Generate locales
>
> sudo dpkg-reconfigure locales
>                       #add correct language
>                               en_US.UTF-8
Done

> locale -a
>       #To check locale
Done

> #Update Time Zone

Done
>
> sudo dpkg-reconfigure tzdata
>
Needs to be done, has been now
>
> Remove emlid repository
>
Never had it.

> sudo rm /etc/apt/sources.list.d/emlid.list
>
> ----------------------------------------------------------------------
>--
>
> sudo raspi-config
> #NOTE: do not Overclock
>                  1 Expand File system
>                    when finished choose to reboot
> If you need other things enabled such as SPI or C12 ect. it can be
> done here
Yes, need spi, but not THAT spi, is way too slow.
> ----------------------------------------------------------------------
>
> sudo apt-get -y update && sudo apt-get -y upgrade
>
Done

> ----------------------------------------------------------------------
>--
>
> # RPI 2 or 3
> sudo apt-get install -y mate-core mate-desktop-environment xorg
> lightdm sudo apt-get install -y network-manager-gnome synaptic
> iceweasel xterm

Not done, and network-mangler can stay locked in the box.

> # RPI 3
> sudo apt-get install -y pi-bluetooth
> sudo apt-get install -y bluetooth bluez blueman

bt keyboard and mouse are working, is this something emlid leaves out?

> ----------------------------------------------------------------------
>-
>
> #Setup network manager

No, I shoot that POS right between the eyes. NM has never learned to 
leave a hosts file based network alone.

> sudo nano /etc/network/interfaces
>                       #Comment out
>                               #iface wlan0 inet dhcp
>                  #iface default inet dhcp
>                               #iface wlan1 inet dhcp
>                               #iface eth0 inet manual
> # Use control key and x to save and save to default
>
> ----------------------------------------------------------------------
>---
>
> #Update rpi firmware without over writing rt kernel
>
> sudo apt-get install rpi-update
> sudo SKIP_KERNEL=1 rpi-update

Not done yet, nor has rpi-update been installed. I would assume that 
could be committed to a script?

> sudo reboot -n
>
> ----------------------------------------------------------------------
>--
>
> #Install Linuxcnc
>
> On RPI goto web page
> http://buildbot.linuxcnc.org/
> Follow directions to install 2.7 or Master, Jessie (uspace: realtime
> with RT-Preempt, and simulation), armhf # first add repository key,
> open Mate Terminal look for it in system tools menu item, you can copy
> and paste from web site page:
>
> sudo apt-key adv --keyserver hkp://keys.gnupg.net --recv-key E0EE663E
>
> # Start text editor Pluma with root privliges like this:
>
> sudo pluma /etc/apt/sources.list.d/linuxcnc-buildbot.list
>
> #Add the following to file for 2.7 then save:
>
> deb     http://buildbot.linuxcnc.org/ jessie 2.7-sim
> deb-src http://buildbot.linuxcnc.org/ jessie 2.7-sim
>
> # Now update the system:
>
> sudo apt-get update
>
> # Now start Synaptic which will only start from terminal
>
> sudo synaptic
>
> # Type in search box linuxcnc find the following, then click and mark
> for installation then apply;
>
> linuxcnc-uspace
> linuxcnc-doc-en
>
>
> Tim March

All done except for master-sim, which when it works, works well indeed.

Probably too long, the important part is this:

pi@raspberrypi:~ $ linuxcnc -l
LINUXCNC - 2.8.0-pre1-2771-gdc2ff49
Machine configuration directory 
is '/home/pi/linuxcnc/configs/sheldon-lathe'
Machine configuration file is '7i90-axis.ini'
Starting LinuxCNC...
Found file(REL): ./hm2-7i90-stepper.hal
Note: Using POSIX realtime
hm2: loading Mesa HostMot2 driver version 0.15
Unknown board: HOST????
hm2_rpspi: rtapi_app_main: Operation not permitted (-1)
./hm2-7i90-stepper.hal:32: waitpid failed /usr/bin/rtapi_app hm2_rpspi
./hm2-7i90-stepper.hal:32: /usr/bin/rtapi_app exited without becoming 
ready
./hm2-7i90-stepper.hal:32: insmod for hm2_rpspi failed, returned -1
Shutting down and cleaning up LinuxCNC...

The no perm is because it did not read 7i90 as the boards ID, so it bails 
out. So what is interfering with the spi? That cable is one I spent 
nearly 3 days building. I have also made 3 of the adapter interface 
boards from OSHPark, and they have never ever talked to one of these 
boards, every byte rx'd is an 0x00. If I have enough 26 pin IDC 
connectors I'll make one about 9" long so it will reach either of the 
other two 7i90's I have.

Thanks Tim.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to