Showing posts with label Mistakes. Show all posts
Showing posts with label Mistakes. Show all posts

Monday, May 20, 2013

Virus Removal: Part 2

Well this is part two, which is unfortunate. As I feared might be the case, we did not get all of the viruses on my relative's computer (see part 1). The next morning after I turned controls back over to my relative, we got a call. Something called Amazon Cloud Drive came up.

Well I can handle this, get in the car and drive over. Turns out Amazon Cloud Drive is not the problem, not even close. Some "mysterious" entity had broken the internet and the sound drivers. More snooping, the Windows Security Service that handles firewalls and such things (I gathered that is what it did) would not launch. Things were going haywire. Well fantastic.

Not having time to deal with it just then I kicked off a virus scan and left. On the way home I made a quick call to my brother. Though it is not his field, he has more experience at virus hunting than I do. He was quite encouraging (NOT). Basically, he suggested the problem was what I had already suspected but had not wanted to concede. He decided it was likely that she had a rootkit.

Well that is bad news. Malwarebytes had "removed" rootkit.0Access the day before, but at this point I felt pretty stupid for believing I had beaten it. His suggestion, reformat the drive with an external program and rebuild the computer from the ground up. "Scorched earth." Right. Well I had not conceded that fully yet.

1. Run Malwarebytes Anti-rootkit BETA. I don't work for them. I promise. I just happened to have seen this feature in the previous days and tried it ( from safe mode). It found a rootkit. I "removed" it. Yeah. Right.

2. Run Bitdefender Rescue CD. Well the Trend Micro rescue disk didn't find it last time, but we'll try it. It booted from Linux and scanned the drive. Interestingly, the internet works when booting from Linux. Yep. Virus.

3. Restore System. After much deliberation it was decided that we should restore the system. This basically resets the computer to an image on a hidden partition of the hard drive. Even if we got the virus, the internet and sound drivers as well as who knows what else were hosed. Yes we probably could fix it, but all she does is use it for email and news. We'll just restore it.

We tried to do this through Windows. No dice. Next, reboot and hit alt-f10 to do it outside of Windows. This took several tries for some reason, but eventually we had success. We did the one that saved her documents. For those that are wondering how long this will take (like we were), it took over an hour.

4. Reboot and reassess  Everything that looks good. Reinstall all the antivirus software. Scan the Backup folder where all her old documents were stored. It found something. Delete that and scan again. Then full system scan.

Now we put the computer back together again and hope for the best. Here's to hoping there is no part 3.

-Matthew

Monday, April 8, 2013

Upload sketch to Arduino Mega with External Programmer

Well I just "wasted" 30 minutes of my life and thought I should share it with the world.

As I have previously mentioned, I have an Arduino Mega with what I believe is a burnt out usb to serial chip. I haven't looked seriously into fixing it, but that might be a project for the future.

Anyway, as I now have a USBtinyISP, I thought I would try to program it with that.

Attempt One:  I found THIS webpage. Apparently you can change the setting in the preferences.txt to always upload via an external programmer. Well that's no good.  I only want to do it with one board. Oh wait,

"If you would rather use an external programmer for only an individual board, you can edit the boards.txt file in the hardware/ sub-directory of the Arduino application directory. Set the board.upload.using parameter to the identifier of one of the programmers in programmers.txt."

Well there's the solution. I'll create a new board that is just a copy of the Mega2560 except with the new settings.

Attempt Two: I found the Mega 2560 part in the boards.txt and go to deciphering. This goes rather slowly until I find THIS. Then I quickly sort it out into the correct lines and change what I believe needs to be changed. 

Upload. Error. Big surprise. 

I change some more settings and reopen the IDE. I go to open the blink example and notice something.

Attempt Three: "Upload Using Programmer". There it sits write below the upload command under the file tab. It works.

I abandoned my attempts to create the edited board file. It would just be redundant now. I don't know how long that option has been there. I checked, and it is there in the oldest IDE version I have (1.0.1). So it has been there at least since last October.

There is a moral to this story. Don't assume that because Google doesn't yield an easy solution, it doesn't exist. You may have just been skimming over it in the IDE.

May you always see the obvious.
-Matthew

Friday, March 22, 2013

Arduino Mega as ISP- broken Arduino

Well it has been a while since I posted anything on here, and there are several good reasons for that. One, last week was spring break, and it was beautiful. I did a lot of stuff outside and never really touched my computer. Two, right before spring break I managed to break my Arduino again. Here's how.

As I have mentioned I got an ATtiny85 to play around with. I thought it would be a natural next step to start doing stuff with just the bare chip. I am by no means an expert in such things and thus went searching for someone else's work that I could shamelessly copy in the name of education. I found this website HERE and began to follow their instructions.

Now to program these chips you need an external programmer. Being a college student and not having a whole lot of money that I just long to spend, I decided to go with the Arduino as ISP route. Well you can go to the website if you don't know what that entails, but to the right there's a picture to give you a general idea. Basically you are piggybacking off of the Arduino's programmer.

This went great! I plugged in all the wires based off of the charts on the high-low tech page, followed the rest of the instructions, and clicked go. Off the races I went, loading blink. I unplugged everything but the power and ground and got a blinking light! Yay!

Now that's cool. I plugged the wires back in and loaded fade. Error. Try again. Error. Sigh.

Now I unplug everything and try to load blink onto the arduino. It took forever to try to upload. Error. I believe it was something like the one below. Its funny that I saw it so many times but never actually copied it down.

avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

Then I got thouroughly depressed and didn't touch it for a few days. Later I began trying to fix it.

Attempt 1: The reset doesn't appear to be working. Google such things. Nothing. Manual reset with a resistor on reset pin. Nothing. I hope this isn't the problem.

Attempt 2: Somehow I decided it might be the ATmega16U2 firmware (the smaller chip near the usb port). Download necessary stuff and reflash it. This took a while for me to figure out, but I finally did it. Successful firmware update, but no results. I never found a good tutorial on how to do this on a Mega, so I will post one later based on what I learned next time.

Attempt 3: Re-download Arduino IDE. Yes, this should have been my first step, but for various reasons it was not. Well this did not fix it either, but then a few days ago I notice that there was a new version 1.0.4. The release notes yielded this, "Fixed a bunch of bugs on Mega2560's bootloader (Mark Sproul)." Bingo I think. My problems are solved.

Well to upload the bootloader I needed a programmer. So now I bought what I should have bought in the first place, a usbtinyisp. I got mine off eBay from a US seller for $15 I think. You can also get kits HERE. There's a picture if you're wondering.

I uploaded the bootloader (go HERE for now). I may do a tutorial on this later too. Who knows. Anyway, I upload the bootloader and it appears to go well until I get an error message. It didn't work. However, I notice that the led is blinking on the Arduino. That's odd. Before it was just on all the time. It wouldn't blink even if  I pushed the reset button. I plugged in the USB cable to the Arduino, and its alive again.

I have no idea what the problem was or what fixed it, but it now works again. The moral of this story (for me anyway) is spend the $15 and get an isp. $15 could have saved me many hours. Then again, I learned a lot through this process. I learned a lot about flashing firmware, loading bootloaders, and maintaining patience.

There will be more posts to come now. I hope this helped someone.
Matthew

Friday, February 22, 2013

Death of an Arduino

Well I said I would tell you about killing my Arduino. So here is the long and short of it.

I decided one night that I had a bit of free time that I would take a break from reading about string theory to mess around with my Arduino. Well looking back at this, this was probably a poor choice.

As I was plugging in the USB cable, the cable that powers the Arduino (from the 8.4V battery) fell over onto the board. The switch was turned off meaning that rather than the switch being connected to the nice insulated cable, it was connected to the open pin. I'm pretty sure I never insulated that tab because.. well because I'm rather stupid.

So, the tab touches the grounded USB socket (the negative wire was not switched). Big spark. Magic smoke escapes. I cried. Nasty smell in my room for an hour or two.

That's how it met its end. Frankly, I'm surprised it survived this long. With all the wires going every which way and me carrying it around and such, it lived a good life. And to be fair, it actually is still working. The last sketch I had on it still runs. Its just the USB to serial chip that is burnt out.

Maybe someday I will look into doing something with it. In the meantime I ordered a new one. I'm certainly glad that I didn't fry a $50 "real" Arduino. Say what you want about buying from China, but if it weren't for the cheap parts from China I would not be doing the stuff I am doing. Granted, I'm not forging any new ground in a research field, but this is part of my education. One day I hope to be a productive, tax-paying (novel idea) citizen. Maybe then I will buy "real" Arduinos.

HobbyKing was out of stock so I ordered one from a US seller on Ebay. $21 shipped. It said genuine, made in Italy, Arduino Mega 2560 R3. I have no doubt that they were lying. If you want a picture of it I'll probably post one when I swap it out on my robot. For now I'm doing some other stuff with my LCD shield and such. It seemed neglected.

Well that's how it happened. Its my fault. I wired the the switch such that there was an open tab and then didn't insulate it (or maybe it just fell off. Either way, my fault). Oh well. Stuff happens. I hope it never happens to you, but if it does, persevere. Find a good friend to talk to. You can find closure.

More on this subject, I referenced this article several times when I was first doing stuff with the Arduino. They are trying to sell their own product, but who can blame them. Its a good read. Interesting stuff on how to kill an Arduino.

Well that's all I have for now. I feel bad for not having any pictures so I found this nice picture to add some color. Its the logo for FIRST Robotics, a program I did in high school. The next few weeks will be pretty exciting in that realm so if you have time, do a quick Google search. Include Ultimate Ascent in the search. Now I'm getting off topic.

See you soon,
Matthew