Jump to content

xeebot

Members
  • Content Count

    37
  • Joined

  • Last visited

  • Days Won

    1

xeebot last won the day on January 11 2018

xeebot had the most liked content!

About xeebot

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. In the mean time, I grabbed this Arduino library and imported it. If that will be good enough, please let me know. I'll keep hammering on it tomorrow https://github.com/finitespace/BME280/
  2. I apologize for re-opening a thread this old, but I'm looking for the library for the Sensors BoosterPack and don't see it available in energia. Does anyone have it and, if so, would you mind sharing? Got two of the Boosterpacks and a couple dozen launchpads and would like to get some use out of them
  3. @energia Sorry for the delay following up on this - had some family medical issues that I had to be present for. If it is okay, I'm posting my version here in case somebody else needs to do the same thing, will save them a few steps I basically combined the sketch you linked to with the WPA example - this allowed me to get details about the board (mac, IP) and do basic troubleshooting. Switched the Ethernet client to WiFi and plugged in my own values for SMTP and email addresses. I put a comment in indicating which lines somebody who wants to use this would need to change. My next step is to combine this with the "test" firmware I wrote for my PCB, and, if everything works on the Launchpad, upload the bin using Uniflash. Will let you know how that works out! Code from attached Sketch: //combines the WPA WiFi example with the Arduino "panic email" sketch - uses WiFi client in place of Ethernet - WPA client shows data about your board and connection in serial monitor // //replace the variables on lines 8, 10, 12, 15, 17, 18, 67, 71, 75, 82, and 84 (for your board and your SMTP server) // //If all variables are correct, board connects to router then waits until SW3 is pressed, then sends email. // #include <SPI.h> #include <WiFi.h> WiFiClient client; //the Pin for SW3 on a launchpad int buttonPinSW3 = 3; //your router's SSID char ssid[] = "YourSSID"; //your router's password char password[] = "YourPassword"; boolean statusCheck=false; //your board's mac address byte mac[] = { 0xDA, 0xE5, 0x13, 0x25, 0x47, 0xB8 }; //your SMTP server char server[] = "mail.send.com"; int SMTPport = 25; void setup() { Serial.begin(115200); Serial.print("Attempting to connect to Network named: "); Serial.println(ssid); WiFi.begin(ssid, password); while ( WiFi.status() != WL_CONNECTED) { Serial.print("Attempting to connect to Network named: "); Serial.println(ssid); Serial.println("."); delay(300); } Serial.println("\nYou're connected to the network"); Serial.println("Waiting for an ip address"); while (WiFi.localIP() == INADDR_NONE) { Serial.print("."); delay(300); } Serial.println("\nIP Address obtained"); printCurrentNet(); printWifiData(); pinMode(buttonPinSW3, INPUT); } void loop() { if(digitalRead(buttonPinSW3)==HIGH && statusCheck==false) { if(sendEmail()) Serial.println(F("Email sent")); else Serial.println(F("Email failed")); statusCheck = true; } else if (digitalRead(buttonPinSW3)==LOW) { statusCheck = false; } } byte sendEmail() { byte thisByte = 0; byte respCode; if(client.connect(server,SMTPport)) { Serial.println(F("connected")); } else { Serial.println(F("connection failed")); return 0; } if(!eRcv()) return 0; // change to your public ip client.println(F("helo [173.6.157.102]")); if(!eRcv()) return 0; Serial.println(F("Sending From")); // change to your email address (sender) client.println(F("MAIL From: <sender@send.com>")); if(!eRcv()) return 0; // change to recipient address Serial.println(F("Sending To")); client.println(F("RCPT To: <reader@readme.com>")); if(!eRcv()) return 0; Serial.println(F("Sending DATA")); client.println(F("DATA")); if(!eRcv()) return 0; Serial.println(F("Sending email")); // change to recipient address client.println(F("To: You <reader@readme.com>")); // change to your address client.println(F("From: Me <sender@send.com>")); client.println(F("Subject: Panic Alarm!\r\n")); client.println(F("The panic button was pressed!!!")); client.println(F(".")); if(!eRcv()) return 0; Serial.println(F("Sending QUIT")); client.println(F("QUIT")); if(!eRcv()) return 0; client.stop(); Serial.println(F("disconnected")); return 1; } byte eRcv() { byte respCode; byte thisByte; int loopCount = 0; while(!client.available()) { delay(1); loopCount++; // if nothing received for 10 seconds, timeout if(loopCount > 10000) { client.stop(); Serial.println(F("\r\nTimeout")); return 0; } } respCode = client.peek(); while(client.available()) { thisByte = client.read(); Serial.write(thisByte); } if(respCode >= '4') { efail(); return 0; } return 1; } void efail() { byte thisByte = 0; int loopCount = 0; client.println(F("QUIT")); while(!client.available()) { delay(1); loopCount++; // if nothing received for 10 seconds, timeout if(loopCount > 10000) { client.stop(); Serial.println(F("\r\nTimeout")); return; } } while(client.available()) { thisByte = client.read(); Serial.write(thisByte); } client.stop(); Serial.println(F("disconnected")); } void printWifiData() { // print your WiFi IP address: IPAddress ip = WiFi.localIP(); Serial.print("IP Address: "); Serial.println(ip); Serial.println(ip); byte mac[6]; WiFi.macAddress(mac); Serial.print("MAC address: "); Serial.print(mac[5], HEX); Serial.print(":"); Serial.print(mac[4], HEX); Serial.print(":"); Serial.print(mac[3], HEX); Serial.print(":"); Serial.print(mac[2], HEX); Serial.print(":"); Serial.print(mac[1], HEX); Serial.print(":"); Serial.println(mac[0], HEX); } void printCurrentNet() { Serial.print("SSID: "); Serial.println(WiFi.SSID()); byte bssid[6]; WiFi.BSSID(bssid); Serial.print("BSSID: "); Serial.print(bssid[5], HEX); Serial.print(":"); Serial.print(bssid[4], HEX); Serial.print(":"); Serial.print(bssid[3], HEX); Serial.print(":"); Serial.print(bssid[2], HEX); Serial.print(":"); Serial.print(bssid[1], HEX); Serial.print(":"); Serial.println(bssid[0], HEX); long rssi = WiFi.RSSI(); Serial.print("signal strength (RSSI):"); Serial.println(rssi); byte encryption = WiFi.encryptionType(); Serial.print("Encryption Type:"); Serial.println(encryption, HEX); Serial.println(); } WiFi_Email_Example.ino
  4. I don't think that is it, BUT it looks great. I should be able to just switch Ethernet for WiFi and go to town. Thank you, sir!!!!
  5. 100% on target, sir! I had actually switched over to a hall sensor on pin 8 with a 10k resistor and just switched to 3. Works like a champ.
  6. Back in June, I wrote a very basic sketch that sent an email via my hosted SMTP server. Unfortunately, the USB drive I stored the sketch on is toast. I don't recall the source and after digging through the examples, libraries and the forum, I'm unable to find an example I might have drawn from. Does anyone have an idea of what code example I might have used? I know I didn't write anything from scratch. I also know I didn't use Temboo or SMTP2Go, as I still have the email in my gmail mailbox (and it came from my hosted domain).
  7. Sure enough, pressing PUSH1 and it reads properly. The reed switch is connected to pin 3 via a jumper wire to the breadboard: const int Hall = 3; pinMode(Hall, INPUT_PULLUP); int HallValue = digitalRead(Hall); Serial.print("Hall Sensor Value: "); Serial.println(HallValue); I've got the Piezo working (PWM), so I'm swapping out the reed switch for a Hall sensor. Once I've got that working as expected, I'll compile and should have firmware that can test all the components on my board. Will post something in this forum documenting all the separate little pieces once I have that working. Thank you VERY much for taking the time to answer all of the questions we noobs keep throwing out here. It makes a big difference!
  8. Please note, Pin 3 is RX on the Launchpad, so I am wondering if the pin is reserved for that reason or if there is something else going on - hopefully, it isn't reserved, as RX is not needed when the BIN is already uploaded and running
  9. Good evening! I'm using a CC3200MOD Launchpad - I have tested this on two of those boards, as well as on a CC3200 Launchpad. The results are the same each time. I have a Reed switch on a bread board. If I connect to Pin 3 (header row one, 3rd pin down from the top), the reed switch value never changes. (results not expected) If I change the jumper wire to Pin 8 and change the sketch from 3 to 8, the Reed value changes state with the presence or removal of a magnet. (expected result) Can anybody point out my error? From the pin map below, the two pins should function the same. Pin Map
  10. You rock! I've managed to come down with bronchitis, so I haven't been at my desk for a couple of days. As soon as I'm over this and am hammering on this again, I'll let you know how it works out.
  11. There is always a VERY good chance I am overthinking things. If you've got time to do it and don't mind, I'll really appreciate it. Also, my board doesn't have a USB connection - I use the Launchpad to flash the board to upload the bin I create in Energia using Uniflash (also can run example programs in debug mode in CCS using JTAG). Does that affect the use of a lightweight package?
  12. No problem. Technically speaking, I'm back at square one, will likely have to go to CCS as I can't get it working with my board, but I'm very grateful for the advice.
  13. I'm not sure I understand - I should just swap the pin numbers in the existing pins_energia.h file in a trial and error approach or I should do something different?
×
×
  • Create New...