More Pi things, IO working on the Raspberry Pi

More Pi things, IO working on the Raspberry Pi

formatting link

My mistake did not have the 26 pole connector... Anyways got the IO working, there is a C library for that, look for bcm2835-1.22.tar.gz

Also have risc OS working on the PI, not sure I if will pursue that, but in theory it should make it possible to get rid of the task switching gap, I will need a very steady IO stream...

The other thing, for all the *fearless* Pi hackers here, my little modification of /etc/passwd, pick you choice of Pie! #pi:x:1000:1000:,,,:/home/pi:/bin/bash #pi:x:0:0:,,,:/home/pi:/bin/bash pi:x:0:0:,,,:/root:/bin/bash

The first is the original, it sucks as nothing works not even remote x as root. The second logs in as root if you do ssh -Y pi@192.168.178.10 (or whatever IP[1]) The third is what I use, here it goes, I love this:

formatting link

[1] I modified it for a fixed IP address, as already dhcp assigned the one from my laptop to the PI... 70 looked like a nice number.

So now we have IO, and the fun can begin, gotta get the scope and test for max speed and task switch interrupt.

On the side: Last night I made backups from the modified image, so I do not lose a Saturday of work, and also wrote all files and notes to a bluray disk. So what's to fear? If you ever mess up in a big way and lose your way, at most one day work is lost. As now there is the SDcard, (SDcards in my case), the copy of the image on harddisk, and the copy of it (all with sha1sums) on bluray on ext2 filesystem. That is how *I* work (most of the time),

My database entry for disk 927:

927 BD-R-25 Platinum 4x inkjet printable LG BH10LS38 ext2 filesystem Raspberry debian 8 GB SDcard image with librtlsdr, xforms, fftw3, xpsa, dump1090 Risc OS image Original debian image Method: dd if=/dev/zero bs=1000000000 count=25 > bluray.iso mke2fs bluray.iso mount -o loop=/dev/loop0 bluray.iso /mnt/loop cp ... /mnt/loop/ # stay below about 22.3 GB du /mnt/loop umount /dev/loop0 growisofs -speed=4 -dvd-compat -Z /dev/dvd=bluray.iso # l /mnt/loop total 13882600 drwx------ 2 root root 16384 Feb 2 17:55 lost+found/

-rw-r--r-- 1 root root 1939865600 Feb 9 04:44 2013-02-09-wheezy-raspbian.img

-rw-r--r-- 1 root root 159063 Mar 6 13:56 Raspberry-Pi-R2.0-Schematics-Issue2.2_027.pdf

-rw-r--r-- 1 root root 109401 Mar 6 13:59 RPi_Low-level_peripherals.html drwxr-xr-x 2 root root 4096 Mar 6 13:59 RPi_Low-level_peripherals_files/

-rw-r--r-- 1 root root 229735 Mar 6 14:01 bcm2835-1.22.tar.gz

-rw-r--r-- 1 root root 102683388 Mar 8 15:27 riscos-2012-11-01-RC6.zip

-rw-r--r-- 1 root root 42 Mar 8 15:30 sha1sum_riscos-2012-11-01-RC6.zip.txt

-rw-r--r-- 1 root root 42 Mar 10 13:26 sha1_sum_rasbian_zip

-rw-r--r-- 1 root root 41 Mar 10 13:41 sha1sum_2013-02-09-wheezy-raspbian.img.txt

-rw-r--r-- 1 root root 1590 Mar 10 16:17 how_to_raspberry.txt~

-rw-r--r-- 1 root root 1590 Mar 10 16:17 how_to_raspberry.txt

-rw-r--r-- 1 root root 8193572864 Mar 10 17:16 raspberry_with_rtlsdr_xpsa.img

-rw-r--r-- 1 root root 3965190144 Mar 10 17:36 media_4GB_sdcard.img

-rw-r--r-- 1 root root 41 Mar 10 17:38 sha1sum_raspberry_with_rtlsdr_xpsa.img.txt

-rw-r--r-- 1 root root 41 Mar 10 17:39 sha1sum_media_4GB_sdcard.img Greetings root

Reply to
Jan Panteltje
Loading thread data ...

Fliing a GPIO bit on / off with that IO libray give 5.1 MHz, with task switch interupts.

5.1 MHz is not bad (700 MHz core), I see a task switch interrupt every 70 uS, that interrupt lasts about .5 to 1 us (tested with nothing else running).

Looks like a little more than 3Vpp. (0 to 3.x V) ||||||||||||||| |||||||||||||||||| ||||||||||||

Reply to
Jan Panteltje

Not bad... But I have a 168MHz STM32F4 in front of me that can toggle a PIO at 84MHz!

Not bad either, the SMT32F4 seems to take a few hundred ns, seems likely it could reliably respond to a 1MHz irq.

--

John Devereux
Reply to
John Devereux

root.

IP[1])

You'd be better off to leave the user pi as it is. If you need a password to the root account, log in as pi and use

sudo bash

to get root access.

You can set / change the root password with passwd, but there is little use compared to the risks.

--

Tauno Voipio
Reply to
Tauno Voipio

On a sunny day (Mon, 11 Mar 2013 14:43:46 +0000) it happened John Devereux wrote in :

That I/O lib has a lot of overhead, the code is amazing, I tried some short cuts and inline and gcc -O4, and got faster, but looked like that created a bus conflict or rather a strange switch in the middle of the waveform, not sure what it is. I think I have the required speed now, why push it?

Reply to
Jan Panteltje

On a sunny day (Mon, 11 Mar 2013 17:37:27 +0200) it happened Tauno Voipio wrote in :

root.

IP[1])

Well, slowly but surely I am beginning to think you all suffer from a severe case of paranoia. The only time I would create a user account is if I was running a Linux server with paranoid incompetents as clients. Make sure you wear gloves when soldering, were a gas mask too, and verify you do not hold that soldering iron by the hot end. And remove the carpet, you may drop something or pee on it in fear of burning your digits.

I dare say, where is the world going.

Reply to
Jan Panteltje

root.

IP[1])

case of paranoia.

with paranoid incompetents as clients.

do not hold that soldering iron by the hot end.

your digits.

Actually, I'm protecting the computer from myself. It is far too easy make a little slip like

rm * .lst

and not running all the time as root may save hours of tedious re-build. The need for sudo forces another re-think before blowing up.

--

-Tauno
Reply to
Tauno Voipio

as root.

atever IP[1])

ere case of paranoia.

erver with paranoid incompetents as clients.

you do not hold that soldering iron by the hot end.

ning your digits.

so do things the Windows way? ;)

-Lasse

Reply to
langwadt

On a sunny day (Mon, 11 Mar 2013 22:03:13 +0200) it happened Tauno Voipio wrote in :

Yes, thats is a mistake that is easily made, as the space bar is big and sometimes easily hit.

I think this is not correct. In all these years, I started with Linux 0.98, probably around that year last century, I made 2 mistakes related to rm, one was rm * -rf in / , wiped out part of X11, took about ten minutes to find the CDROM, and copy it back, and the other was the one you described above, even 2 times, backup less than 10 minutes.

On the other side of the fence is users typing 'sudo' before every command, and being clueless if something does not work (configuration files, networking, fiddling with strange GUIs while it is only few files in /etc/)

I just installed my GPS program (gpspc) and serial communication program (ptlrc) on the Raspberry, mainly copy from PC via scp, and then recompiled for ARM. There is no GL for that Pie it seems (glut.h missing) so I had to make some code changes, and I noticed Pie does not ask for confirmation if you type rm * And I use that all the time as need to remove the old object files (for x68) and binaries (for x86).

Hey and it is all working, had the USB to serial adaptor and my frequency counter working on the Pie. The GPS uses i2c via the parport, and as there is no parport I will have to port the i2c to some GPIO pins.

So, been typing all evening, and made a backup of the 8GB sdcard too. Should do that again.

I am actually much more concerned about the SDcard writes (maximum it will take), but I noticed filesystem is ext4 mounted noatime, and much is on RAM, so maybe not worry.

Reply to
Jan Panteltje

On a sunny day (Mon, 11 Mar 2013 14:17:30 -0700 (PDT)) it happened " snipped-for-privacy@fonz.dk" wrote in :

Did Bill Gates pee on the carpet?

Reply to
Jan Panteltje

bur=

haven't seen his carpet ;)

but he taught the world to run as root/administrator

-Lasse

Reply to
langwadt

In my own experience (several decades of it): running everything as root, or doing all of the development on a "live" system, or other such "power developer" practices are all well and fine, effective time-savers ...

... until something goes wrong. And, something *will* go wrong. I don't think *anybody* is good enough to do software development for hours a day, day after day, without suffering from an occasional "slip of the keyboard". I certainly am not - I gave up any illusions of my own perfection and infallibility many years ago, having ground my face into the truth one time too many :-)

Some mistakes are easily recoverable - copying a few files from a CD or doing a "force reinstall" of a software distribution.

Some mistakes are *not* easily recoverable. Even a single careless or mistaken command can wipe out *days* of work... forcing you to re-create the work "from scratch". From one day to the next, doing everything as "root" saves you time... but the time you lose from an occasional goof more than makes up for it, IMO.

I think of "run as a standard user, and su or sudo only when needed" as being a lot like applying routine safety precautions when working with a wood saw, router, drill press, etc. You'll get away with ignoring the precautions a lot of the time... 99%, 99.9%, or even more. Then, once in a while, you lose a thumb or an eye.

If you look at experienced wood-shop and machine-tool operators who have suffered a significant injury, and ask them honestly, a lot of them will admit "Yeah, I was taking a short cut, and I knew I shouldn't, and it went wrong."

--
Dave Platt                                    AE6EO 
Friends of Jade Warrior home page:  http://www.radagast.org/jade-warrior 
  I do _not_ wish to receive unsolicited commercial email, and I will 
     boycott any company which has the gall to send me such ads!
Reply to
Dave Platt

On a sunny day (Mon, 11 Mar 2013 14:46:14 -0700 (PDT)) it happened " snipped-for-privacy@fonz.dk" wrote in :

Bill started out as programmer, so he had no fear of flipping some bits.

I was thinking last night, that if there is any reason why fear of root is hammered into peoples heads, it is this:

There are people trying to make big money with open source and Linux. RatHead (also known by the alias redhat, and HELL that 'red' hat actually means ROOT!), and suze these days (not in the old days), have gone to great trouble to 'shield' the people from the crap they deliberately create (think of RatHead creating their own incompatible libc) only for ONE reason: You Need To Subscribe To Their Support == MONEY and Yes they make a profit, and Yes they are f*cking in bed with Balmer. So they even show a red screen if you log in as root, as you should not do that, you should be an idiot who pays for what a 12 year old can learn in a week while asleep.

So that leaves Debian, and lots of distros are based on it (grml, Ubuntu, what not). And Slackware, also pretty clean but not as easy for a beginner I think, with its own incompatibilities. I just filled in a questionnaire on heise.de (In German)

formatting link
about the OSes I am using, and the list did not fit in the little box for all the Linux distros I have on some partition or other. Actually the questions asked show some silly view of computahs and OSes in a way.

And their is the political times we live in, old days you would take apart your car, these days do not open the hood for fear of ? (tiger in the tank :-) ;-)???LOL). no matches, no assault weapons, no pocket knives longer that a few mm, but anybody can drive a car into a parade and kill ten people at the time (something like that happened recently here), open the gas tap, light a candle, and blow the flat sky high, derail a train by using a chainsaw cutting some trees on the rails, and talking about chainsaws, have you seen the Texas Chainsaw Massacre? Well, fear fear, it is all bogus. Those who want to destroy will destroy (just make an alliance with the US, start a revolution, they will give you the ammo, makes no difference if you are an insane islamitic fanatic, weapon sales help the economy for those who manufacture, and if you win the revolution you will dance to their tune, if you do not win they will sell weapons to somebody else who will try. schizophrenia, on one hand total destruction, on the other hand a bunch of lawyers fighting for money over hot coffee.

Society,, human nature, probably always been like that. When in school I learned history, and sort of was presented in the context of 'these days it is better', Well it is not, it is the same thing all over again,. So, here we are, your little computah can be destroyed by you becoming root and typing rm -rf /* or something like that (every time I type something like that I get the creeps, stop and re-read), and it ALSO can be destroyed by taking a hammer and smashing it. However in the first case repair is likely cheaper, just re-install, what you made on it was not that new that it makes a difference for humanity, be honest, and if it really was, then you should have backed it all up.

Thank you.

Reply to
Jan Panteltje

On a sunny day (Mon, 11 Mar 2013 15:27:41 -0700) it happened snipped-for-privacy@radagast.org (Dave Platt) wrote in :

You do not make backups? DAYS of work? Where I worked there were daily backups and those went into the vault.

Machine operators? That is a different story, see my other reply today, although soon they will solder on a new hand or arm just the same.. LOL

Takes a few minutes to backup an 8 GB SDcard, sometimes I do it twice a day:

-rw-r--r-- 1 root root 8193572864 Mar 11 21:03 raspberry_with_joe.img

-rw-r--r-- 1 root root 8193572864 Mar 11 22:51 raspberry_with_ptlrc.img

Have to give it some different names, last one is actually the auto-pilot version, was a lot of typing almost 2 hours it seems ;-)

Somebody get real please!

Reply to
Jan Panteltje

On a sunny day (Mon, 11 Mar 2013 14:43:46 +0000) it happened John Devereux wrote in :

PS I bypassed that I/O lib, and now have:

12,759,823 Hz 12,767,055 Hz 12,764,239 Hz 12,757,935 Hz 12,767,951 Hz 12,763,215 Hz 12,760,495 Hz

on the frquency counter for the fastest flip on some IO pins at the same time (say half a byte out). From: file:///root/download/html/raspberry_PI/RPi_Low-level_peripherals.html#P3_header

Modified the example C code to read:

int a;

// Set GPIO pins 7-11 to output for(g = 7; g

Reply to
Jan Panteltje

(say half a byte out).

file:///root/download/html/raspberry_PI/RPi_Low-level_peripherals.html#P3_header

I've had a pi for months, got it working instantly with Debian, SD card, USB:WiFi stick and a HDMI TV. Kept rebooting itself because I thought I would see if it worked powered from a USB port on the TV. It did not. Got a £2 USB charger off ebay and it was fine.

So then it was "hmmm... now what?"

Just waiting for something to do with it now! :)

That broadcom CPU with the stacked DRAM is nice, allows cheap simple

2(?) or 4 sided PCB. Pity the accessible high-end ARMs are not like that, all BGA packages, massive external busses and 8-layer boards as far as I can see.
--

John Devereux
Reply to
John Devereux

On a sunny day (Tue, 12 Mar 2013 15:20:16 +0000) it happened John Devereux wrote in :

(say half a byte out).

file:///root/download/html/raspberry_PI/RPi_Low-level_peripherals.html#P3_header

bytes,

Yes those chips become more difficult to use for the home designer. OTOH getting cheap boards is easier from China. The FIFOs are DIL, and for soem other chips I have adaptors.

My new HDMI Samsung monitor came today, I ust say they learned since I bought the previous one, look great on the PI.

I will try to use netcat to stream transport stream to the pi, and then mplayer You can make netcat listen on port 1234 like this on the pi: netcat -l -p 1234 | mplayer -fs -vop pp=0x20000 -monitoraspect 1980:1020 -cache

1000 -

And then send the media file from some other PC: cat movie.ts | netcat IP_ADDRESS_OF_PI 1234

Should work for .avi too. Have not tried it yet on the Pi, but I noticed it has netcat installed, maye those commands need minor changes, monitor resolution for starters.

The possibilities are endless. Now I will write something that reads stdin and writes 16 bits at the time to that GPIO header, and feed it with netcat like the example above, and see if I can get enough speed. Can take a while, maybe in the weekend...

netcat -l 1234 | panteltjes_io_program

Saves writing the TCP client.

Reply to
Jan Panteltje

time (say half a byte out).

file:///root/download/html/raspberry_PI/RPi_Low-level_peripherals.html#P3_header

bytes,

-cache 1000 -

Think there is a XMBC for the pi - expect you would sneer at that though :)

It should make quite a good media player, has an overpowered graphics core and a mediocre ARM as these things go. But ideal for that.

Well you can install what you like with debian (or *-ian) of course.

Yes I like netcat, still use it for network backups sometimes. My recipes seem to use ssh now though.

dd if=/dev/hda bs=1024K | ssh remote_host dd of=/dev/newdrive bs=1024K

that GPIO header,

speed.

--

John Devereux
Reply to
John Devereux

On a sunny day (Tue, 12 Mar 2013 17:58:42 +0000) it happened John Devereux wrote in :

Not everything, open GL has not happened for the Pi I think?

Yes ssh is cool, and it is indeed better to send movies and media encrypted over the wireless lan :-)

BTW I wrote (could not resist) some more IO, and have all 16 bits working now of GPIO. Did not work at first until I found I had a revision 2 board, and they swapped GPIO 0, GIO1 and GPIO 21 for GPIO 2, GPIO 3 and GPIO 27.. Now it works.

BTW I accidently gave a local link, you can find out a lot here:

formatting link

There is also a gpio user space program, so then you can do I/O from the shell, but thats is likely much slower, but nice for testing LEDs etc.

formatting link
That will report the board version ... :-)

Reply to
Jan Panteltje

that seems a recipe for unusable backups unless /dev/hda* is unmounted first

--
?? 100% natural 

--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
Reply to
Jasen Betts

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.