Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


xeebot last won the day on January 11

xeebot had the most liked content!

About xeebot

  • Rank
    Advanced Member
  1. @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 []")); 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
  2. 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!!!!
  3. [SOLVED] Launchpad Pin 3 vs Pin 8

    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.
  4. 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).
  5. [SOLVED] Launchpad Pin 3 vs Pin 8

    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!
  6. [SOLVED] Launchpad Pin 3 vs Pin 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
  7. 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
  8. 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.
  9. 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?
  10. 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.
  11. 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?
  12. That did it. I removed the 6.3 folder and it compiles.
  13. Good morning! I set up a new install of Windows with CCS and Energia installed. While going through the quick start guide, I found I was unable to compile the Blink example. I assumed that the issue was due to using the drivers from Ti's SDK rather than DPInst64 - I was unable to get a copy of the drivers posted here. After obtaining the drivers and installing, I still get the same error. I have also installed Energia on a second and get the same errors during compile. Error messages are below: <command-line>:0:15: warning: ISO C++11 requires whitespace after the macro name In file included from c:\users\doug\appdata\local\energia15\packages\energia\tools\arm-none-eabi-gcc\6.3.1-20170620\arm-none-eabi\include\string.h:10:0, from C:\Users\Doug\AppData\Local\Energia15\packages\energia\hardware\cc3200\1.0.2\cores\cc3200/Energia.h:8, from C:\Users\Doug\AppData\Local\Energia15\packages\energia\hardware\cc3200\1.0.2\cores\cc3200/Arduino.h:3, from C:\Users\Doug\AppData\Local\Temp\builda9304c47a9d01225cec361d757013532.tmp\sketch\Blink.ino.cpp:1: c:\users\doug\appdata\local\energia15\packages\energia\tools\arm-none-eabi-gcc\6.3.1-20170620\arm-none-eabi\include\stdlib.h:225:8: error: conflicting declaration of C function 'char* utoa(unsigned int, char*, int)' char * _EXFUN(utoa,(unsigned, char *, int)); ^ In file included from C:\Users\Doug\AppData\Local\Energia15\packages\energia\hardware\cc3200\1.0.2\cores\cc3200/Energia.h:10:0, from C:\Users\Doug\AppData\Local\Energia15\packages\energia\hardware\cc3200\1.0.2\cores\cc3200/Arduino.h:3, from C:\Users\Doug\AppData\Local\Temp\builda9304c47a9d01225cec361d757013532.tmp\sketch\Blink.ino.cpp:1: C:\Users\Doug\AppData\Local\Energia15\packages\energia\hardware\cc3200\1.0.2\cores\cc3200/itoa.h:34:14: note: previous declaration 'char* utoa(long unsigned int, char*, int)' extern char* utoa( unsigned long value, char *string, int radix ) ; ^~~~ exit status 1 Error compiling for board CC3200-LAUNCHXL (80MHz). Any assistance would be appreciated.
  14. Please disregard. I was able to get a copy of the driver file and the error is still there. Will post it in a new thread. Also, if anyone else needs the driver before the admins are able to update the link or restore the missing file, I've attached it here. cc3200_drivers_win.zip