I’m sure no one noticed, but the server was down for about a week or so. I was getting some disturbing output straight to my console about file io failures that repeated constantly and would not even allow you to work on stuff in the foreground.
The server had a 20gig drive with linux, a 30 gig drive with the web files and a 130gig disk for storage. All these were crammed into a very small computer. Anyway the 20 gig was failing, so I made a backup using dd onto another partition of the 130gig. Then I spent about 3 days trying to get the system to boot from the 130gig hdd to no avail. It seems that something in that drive will just not allow it to boot. I had figured this out before and thats why i was using it for storage. Anyway that caused me to learn a lot about grub and lilo. I just reformatted the 20 gig drive and reinstalled the os on it. I ended up using grub, I also ended up using a different OS.
I tried the latest version of slackware, I figured since i was reinstalling midas well get the latest version. I hated it ! They use the resource heavy KDE, there is no apt-get or yum like functionality. They still have that package system where you have to use pkg-tool in the dir where you have downloaded packages and then go through each one and say yes or no. It is incredibly hard to get those packages, you might know you need a program to do this but unless you know its called progname.ver.somecrazystuff.tar.tz.ver34 good luck finding it on their site. You could also just browse through thousands of packages separated alphabetically and say “maybe this is what i need?” Since I’m also familiar with ubuntu i got the ubuntu server version.
The installation of ubuntu was fast and easy. The boot cd also has a way to load a kernel so you can get in and do stuff like “grub-install” (which does not exist for slackware). After I installed Ubuntu I got my firewall script to work just fine on it. Everything i wanted i just “sudo apt-get install” ed it. Ubuntu also comes with awesome tools like gnu screen and nano, it also has a updated version of vi I had not seen before. And of course the updates in ubuntu are a snap, so i wont end up with a OS that has not been upgraded for 2 years like I did with the version of slackware that crashed.
I did very much like the old version of slackware, version 10 or 11 I think. I loved the way it gave random quotes every time you log in. Also the boot cd allows you to specify a different kernel, which i couldnt figure out how to do with the ubuntu cd. This was very helpful when i had 3 different partitions i was trying to boot. But besides that i’m sticking with ubuntu with xfce4 installed !
Everything is up and running now, obviously. I had backups so most of the stuff got restored. A lot of the stuff got a nice cleaning, i had a lot of junk ! Wordpress turned out to be easy to restore thanks to their backup/restore tools. For my other custom web page (social network site) I opted out of my custom stuff and installed dolphin, the dolphin install took me a few hours then i wrote some scripts to do some crazy stuff with the mysql database so all 500 users from before would just pop up in the totally different social networking software, that was not easy but I was able to do it. I had to also write scripts to resize their photos and store them in directories and all kinds of crazy stuff. If you need to port some site to a dolphin site let me know I can help.
I always have been good with backups, but now I keep a duplicate of the entire linux root disk so i can at any time swap it out and replace it without delay. I’m using the dd for most of that.
I will write about my updated firewall script and the other stuff I did to get the ubuntu system to do all that my slackware system did, just got to get some free time. I’ve also made some diagrams and such, hope to write about that soon.
Today I noticed that I had lost all the work I did over summer (which was a bunch). I was able to find them in old binary files for mysql but the pictures and attachments are all gone for good. Here is what wp told me
1. Importing post Using IPTABLES on your linux router... (2 comments) 2. Skipping attachment http://zonemikel.com/wordpress/wp-content/uploads/2009/05/simplers232.jpg 3. Skipping attachment http://zonemikel.com/wordpress/wp-content/uploads/2009/05/ttl-rs232-conv-top.jpg 4. Skipping attachment http://zonemikel.com/wordpress/wp-content/uploads/2009/05/ttl-rs232-conv-back.jpg 5. Skipping attachment http://zonemikel.com/wordpress/wp-content/uploads/2009/05/card-reader-conv.gif 6. Importing post RS-232 to serial Conversion, using 2 transistors... (1 comment) 7. Skipping attachment http://zonemikel.com/wordpress/wp-content/uploads/2009/05/pic-blew-up.jpg 8. Importing post Blow UP your Pic's... 9. Skipping attachment http://zonemikel.com/wordpress/wp-content/uploads/2009/05/rf-out-backspace-fullshot.jpg 10. Skipping attachment http://zonemikel.com/wordpress/wp-content/uploads/2009/05/rf-out-tab-fullshot.jpg 11. Importing post SoundCard Oscilloscope... 12. Skipping attachment http://zonemikel.com/wordpress/wp-content/uploads/2009/05/protoboard-02-top.jpg 13. Skipping attachment http://zonemikel.com/wordpress/wp-content/uploads/2009/05/protoboard-02-bottom.jpg 14. Importing post Protoboard Version 0.2... (2 comments) 15. Skipping attachment http://zonemikel.com/wordpress/wp-content/uploads/2009/05/pic-uart-aa.jpg 16. Skipping attachment http://zonemikel.com/wordpress/wp-content/uploads/2009/05/rs232-a.jpg 17. Importing post RS232 Revisited... (1 comment) 18. Importing post Standard Lab Journal Format that I will be using... (1 comment) 19. Skipping attachment http://zonemikel.com/wordpress/wp-content/uploads/2009/05/network-setup.jpg 20. Skipping attachment http://zonemikel.com/wordpress/wp-content/uploads/2009/05/firewall-flow-chart.jpg 21. Importing post My Linux Firewall Script... (43 comments) 22. Skipping attachment http://zonemikel.com/wordpress/wp-content/uploads/2009/05/rcr-rx-breadboard.jpg 23. Skipping attachment http://zonemikel.com/wordpress/wp-content/uploads/2009/05/rcr-tx-protoboard.jpg 24. Importing post Testing RCT-433-AS-TRANSMITTER and RCR-433-RECIVER... (10 comments) 25. Importing post Ubuntu + VirtualBox + Existing WinXP 64 Hopefully !:... (6 comments) 26. Importing post Ubuntu 9.04 + Virtual Box (non ose) + usb grayed out... (32 comments)
At least i got the information back and i wont have to start out from scratch when i pick up those projects again. If i find the pictures i will upload them so they show up.
to solve this
add yourself to the virtual box group
type “grep vboxusers /etc/group” to get your id .. it will be the number
add
none /proc/bus/usb usbfs devgid=###,devmode=664 0 0
to your /etc/fstab where ### is the number you got with the previous command.
i tried all the other stuff, spent all day on it this worked .. if you have version 9.04 of ubuntu do this ! If you have VirtualBox ose from the package manager your usb devices wont work at all. Just go to the virtual box webpage and get the deb.
My purpose was to test this transmitter/receiver pair to see how far i could go and still reliably transmit data. I used my protoboard to transmit. The reciever was attached to a uart to rs232 converter then to the db9 port on my computer and i watched the input from hyperterminal.
Get and study data sheets for the transmitter and reciever. Brush up on rs-232 and ttl signaling levels.
The first thing i did was get the Conversion circuit working. I’ve found that the other circuit i have listed does not work well with the 2N3904/6 transistors that i have on hand. I was only able to get the uart to rs232 portion to work, as soon as i plugged in the capacitor or the line going to rs-232 RX the circuit would stop working. So I only hooked up half of the ciruit using a 2N3906 and three 10K resistors. You can do that or use the other one way circuit. You should be comfortable enough with the signalling levels by this point to do this easily, if not i suggest you go back to those sections.
After thats hooked up connect it to the tx pin on the pic to make sure its transmitting correctly. Then hook up the reciever and put the data out line where your pic was connected (before the 10K going into the base of the transistor). You can get the data sheets for the reciever and transmitter in the links that i posted above in the equipment bullets. Hooking up the reciever is really simple, its just ground and power lines and a data out. I hook up all the ground and power lines just to be sure, and when in doubt remember vsS = “sink” so its the ground.
I hooked the transmitter into my “protoboard”.
There is a program on the pic that just transmits a number like 10 times and then does a newline. That way i can print out lots of data and see what number it messed up on. I used the lowest setting i could for the pic, since it has a 20Mhz clock i can use any baud rate slower than 1200.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #include <16F877.h> #device adc=8 #use delay(clock=20000000) #fuses NOWDT,HS,NOPUT,NOLVP #use rs232(baud=1200,parity=E,xmit=PIN_C6,rcv=PIN_C7,bits=8) int i =0; int j=0; void main() { setup_adc_ports(NO_ANALOGS); setup_adc(ADC_OFF); setup_psp(PSP_DISABLED); setup_spi(FALSE); setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); setup_timer_1(T1_DISABLED); setup_timer_2(T2_DISABLED,0,1); output_b(0xFF); printf("\f \f \f \r \f \f \f \r \f \f \f \r"); printf("Start"); while(1){ for (j=0;j<10;j++){ printf(".%i",i); } printf("\r\n"); i++; } } |
Filter Capacitors
In the datasheet for both the transmitter and reciver it says you should use a “bypass” and “filter” cap. I noticed a great improvement of signal quality when i installed these. Pretty much for both of them i just connected them between ground and power in close proximity to the chip, I did this on both the tx and rx ends. You should be able to make it out from the pictures.
Antenna
There is some weird calculation to get “1/4″ of the wave or soemthing like that to calculate the optimum lenght of the antenna. Other people calculated it to 17cm. POST LINK HERE So, I just used a 17cm peice of telephone wire.
The pair works pretty good going at 1200 baud, I was able to transmit through walls. I transmitted at least 20 feet away through walls without loosing any info. This was only after installing the filter capacitors though.
In the datasheets it recommends that you invert the output signal on both ends. This allows you to only transmit when you are actually transmitting, if you dont do this to hold the line without sending data you have to send a ‘1′, but if you invert before it hits the transmitter and then invert coming out of the reciever then you wont need to waste power. If you are transmitting from the pic then you need to set the INVERT option in your program, or you can just invert after that. I didnt implement this part but i might later on.
When you are not transmitting the reciever picks up some weird square wave that does strange things. Then, when you start to transmit some of this weird square wave is picked up in the beggining of your signal, this almost always makes the first part of a string of data get garbled. You can get around this by just constantly transmitting data, which might not be efficent. Possibly you could create some kind of circuit to filter this out, or maybe by inverting the singal it would help ? Just something to consider.
Depending on the needed applications of this it seems to be a very nice way to transmit data, I plan on making a RC car, for that it should work just fine.
I’ve been wanting to organize my findings in a easy to read/reference way. So, I’ll be using a standard lab journal format for most of the things that i start as of now. Of course, it does not apply to everything. I’ve done so much stuff that i never wrote down anywhere, i want to be sure i can look back at stuff i do from now on. Anyway the standard format ill be using (thanks to my teachers)
Standard Lab Format
The following is a description of the standard lab format to be used:
I. Each lab entry should start with the title of the experiment and a brief description
II. The equipment to be used should be listed; leave some room below the initial list to add additional equipment and parts.
III.A prelab section (when applicable) should include any preliminary work to be done prior to coming to the lab.
IV. The procedure section describes the activities done in the lab. The reader of your journal should be able to follow your description without referring to a manual or handout, but you may summarize in your own words. Record your data, figures, sketches and observations. Be sure to label everything.
V. In the conclusions, you should write in a narrative style. Summarize your results and condense data when appropriate. Answer all questions asked.
Even though I have studied this subject several times it still continues to annoy me. This will be a in depth disscussion (kinda for myself) of the signal levels and such. Im wondering if CCS C is inverting the signal coming out of the pic so that its ready for consumption by the db9.
This straight out sort of conversion works off of the fact that most rs232 with short range cables can work just fine with +/- 3 volts. So if you use a transistor to invert the pic signal and a resistor to sink the current when the line is 0 you will get +/-3 volts to drive the rs232 line. So basically we invert the data coming out of the pic and add a resistor to that so when the pic outputs a 1 it is inverted to a 0 then sunk to the resistor to make -3 ish. This is best looked at with a table
Table 1
Pic out | RS-232 In
0volt | +3volt
5volt | -3volt
This is because for the pic a ‘1′ is 5v and for the rs-232 a ‘1′ is less than -3volts, likewize for the pic a ‘0′ is 0v and for rs-232 it is above 3v. So its pretty easy (in theory) to convert from the pic to rs-232, converting from rs-232 to pic levels is more tricky though. But, enough theory and such lets see what we actually get through the scope.
Here I will show you (and myself) the results i get from rs232 and pic while sending the same characters. Hopefully after looking at everything and putting it in perspective we will be able to clearly see whats going on, or we will realize what we are doing wrong.
Setting the scope (soundcard scope)
I’m going to send ‘A’ then ‘a’ at 1200 baud via the pic, and via rs-232, we will be using eight bits with one stop bit. This makes 9 bits total so 1200/9 gives ~133 Hz for each bit. A less confusing way of figuring this out is: we have 1200 bits per second so thats 1/1200 8.3e-4 seconds or (*1000) .83 milliseconds for each bit. We know that we are getting 9 bits so to see the “whole thing” we use .83ms*9bits= 7.5ms. When i set my scope to 8ms i see nothing so i will just use about 60ms then zoom in.
Getting the shot
If you turn on your speakers and your using the soundcard scope you will be able to “hear” the bits go through. I use this as a metronome and i hit the run/stop button to get a good shot of what was sent. Then in the mid bottom i go to the “measure” setting and put it on cursor time. Then i get the blue lines and drag them from the start till about 130hz. This is what i get
So where i have the blue lines is the first char ‘A’ and the rest is the second char ‘a’. From http://www.asciitable.com/ we know that ‘A’ is 65D or 1000001 in binary. Looking at the output we can see we have something like 10???01, we know those four bits so the rest must be 9-4=5. But, I think there is always a “start” bit so that would make it 10 bits we really have so 10-4=6, and that chunk in the middle is all 1’s so 1011111101 is what we have which looks like
start bit | (data)’ | stop bit
I know we cant tell with this one but the data is sent lsb first, and yes that is the inverse of the data. So, where there was a 1 there is a 0 and so forth. This is what we get out of the pic, there is no manipulation its just “putc(‘A’)” so either it should be inverted, or ccs c is inverting it for us. Looking at the ‘a’ we see it is 1100001, and we are getting 10???001. Since we can make out 5 bits, 5 are left that chunk is 1’s so we get 1011111001. Which is just like before start/stop bits and lsb first inverted data. You dont have to figure out just by looking at it what the bits are you can start from the first bit and set f=134/9 and see what each bit is if need be.
Doing the same thing with RS232
It wasnt as easy to get the shot with rs232 but i opened hyperterminal set bits to 8 stop bits to one and baud to 1200. Then while hitting ‘A’ i hurried up and hit run/stop to get this.
From before we know that ‘A’ is 1000001, and yes all that below the red line is negative so we get “1011111101″, assuming that second bit is supposed to be above 3v (what else?). Also i already inverted everything from rs232 to ttl in my head. So we see that here too we get the data portion inverted.
Well, this is what we are getting, but according to sites like http://www.winpicprog.co.uk/pic_tutorial7.htm we should be getting something compleatly different, mainly inverted stuff. But im going to see terminator “salvation” in a hour so ill have to come back to this
Wordpress blogging software seems to be the way to go. I tried some others breifly, this one is much better.
I think a blog is more of what I was looking for. I just want to write about stuff I do, add pictures and files and such. Then people can comment on them. The forums is more of a community effort, where several people add stuff and all the replies count.
Anyway if anyone else wants to blog here just let me know and I’ll add you. My old forums are here for keepsake click link.

Categories
Tag Cloud
Blog RSS
Comments RSS

Void « Default
Life
Earth
Wind
Water
Fire
Light 