Jump to content
43oh

xeebot

Members
  • Content Count

    37
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by xeebot

  1. 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 :)

  2. @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

  3. 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).

     

  4. 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!

  5. 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

     

     

  6. 1 hour ago, energia said:

    It is not that hard really. You  might be over thinking it. You might have quite a bit more challenging if moving away from Energia especially with WiFi.

    I can put a Skeleton package together tomorrow to show you how easy it is to create a custom lightweight package based on the core package. It will be the same as the other example I linked to in an earlier post. Please let me know if you are interested. Otherwise good luck with CCS/Driverlib/etc.

    Robert

    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?


  7. 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. 


     

     
  8. Can anyone send me a copy, please? I have the SDK installed, so the board shows properly in Device Manager, but I get a compile error in Energia.

    Prior to this, I did a clean install of Energia on a new install of Windows and when I went to grab the CC3200 drivers, they're not available:

    http://energia.nu/guide/guide_windows/

    The link to http://energia.nu/files/cc3200_drivers_win.zip  shows:

     

    Oops! Our 404 is showing...

    That page can’t be found.

    Nothing was found at this web address. Click your back button, use the menu tabs, or try a search?

     

     
  9. I missed this when I answered the Pm yesterday!

    There are 10 GPIOs (1 ADC, 1 PWM, 2 UART)

    GPIO  0    PIN 44    ADC - EN   (voltage measurement)
    GPIO  1    PIN 46    TX (UART)
    GPIO  2    PIN 47    RX (UART)
    GPIO  4    PIN 49    VMEAS_BAT  (voltage measurement)
    GPIO  5    PIN 50    ADC - DRV5053 - omnidirectional Hall sensor
    GPIO 10    PIN 3     PWM - Piezo
    GPIO 12    PIN 9     LED
    GPIO 13    PIN 10    DRV5032 bi-directional Hall sensor 
    GPIO 14    PIN 5     LED
    GPIO 28    PIN 19    LED

    Is that too many to remap an existing board?

  10. On 7/18/2017 at 12:16 PM, energia said:

    I would suggest to create your own variant in the variant directory. Then add that variant to board.txt which will make it available in the Energia boards menu.

    Be carful with directly modifying the core. If you install a core update through the board manager, you will loose all your modifications. A better way but more complex would be to create your own installable light weight package. Here is an example of a lightweight TivaC package that I put together a while ago. The downside is that you will have to be able to host the .json file somewhere so that you can point Energia to it in the preferences->Additional Boards Manager URLs.

    http://energia.nu/packages/package_wrigley_index.json

    Robert

    @energia

    Happy New Year, Robert!

    I've been on quite a roller coaster getting my board ready, but it is finally finished and I can focus on my firmware.

    Could you possibly give me some guidance on what I actually need to do to create a light weight package?

    I can extract and duplicate my own version of each file in each archive if needed, but are there any components that I don't need to reproduce? Is there any other guidance you can share to give me some direction?

    Thanks
    Doug

  11. @energia

    Thank you, Robert!

    Since this is a variant of the CC3200, I assume I'll add it to:

    C:\Users\username\AppData\Local\Energia15\packages\energia\hardware\cc3200\1.0.2\variants\

    That should give me a quick stop-gap for making test firmware for the new PCB.

    Making a lightweight package is probably the way I'll go, and hosting will not be a problem, I just have to puzzle out what I'm doing :)

    I really appreciate the advice!

  12. Hello, everyone!

    Don't know if @Rei Vilo or @energia would like to make a suggestion, but I hope so! :)

    I'm working on a project using the CC3200Mod. The PCB should be ready later this week and I'd like to give the designer a basic firmware file to test it. This was no problem on the launchpad, but after we went over the schematic, we found that the pin layout is very different between the CC3200 and the CC3200Mod. 

    Working with launchpads doesn't make a difference, but the PCB doesn't have those ports available, everything is connected to the pin on the chip.

    Will I be better off by modifying my pin_energia.h file to represent the CC32000MOD's layout or should I map the individual GPIOs in my sketch?

    Current pin_energia.h (matches CC32000 pin out):

    const uint16_t digital_pin_to_pin_num[] = {
        NOT_A_PIN,    /*  dummy */
        NOT_A_PIN,    /*  1  - 3.3V */
        PIN_58,        /*  2  - GPIO_03 */
        PIN_04,        /*  3  - GPIO_13 */
        PIN_03,        /*  4  - GPIO_12 */
        PIN_61,        /*  5  - GPIO_06 */
        PIN_59,        /*  6  - GPIO_04 */
        PIN_05,        /*  7  - GPIO_14 */
        PIN_62,        /*  8  - GPIO_07 */
        PIN_01,        /*  9  - GPIO_10 */
        PIN_02,        /*  10 - GPIO_11 */
        PIN_15,        /*  11 - GPIO_22 */
        PIN_55,        /*  12 - GPIO_01 */
        PIN_21,        /*  13 - GPIO_25 */
        PIN_06,        /*  14 - GPIO_15 */   
        PIN_07,        /*  15 - GPIO_16 */   
        NOT_A_PIN,    /*  16 - RESET */
        PIN_45,        /*  17 - GPIO_31 */
        PIN_08,        /*  18 - GPIO_17 */    
        PIN_18,        /*  19 - GPIO_28 */
        NOT_A_PIN,    /*  20 - GND */
        NOT_A_PIN,    /*  21 - 5V */
        NOT_A_PIN,    /*  22 - GND */
        PIN_57,        /*  23 - GPIO_02 */
        PIN_60,        /*  24 - GPIO_05 */
        PIN_58,        /*  25 - GPIO_03 */
        PIN_59,        /*  26 - GPIO_04 */
        PIN_63,        /*  27 - GPIO_08 */
        PIN_53,        /*  28 - GPIO_30 */
        PIN_64,        /*  29 - GPIO_09 */
        PIN_50,        /*  30 - GPIO_00 */
        PIN_17,        /*  31 - GPIO_24 */
        PIN_16,        /*  32 - GPIO_23 */
        PIN_60,        /*  33 - GPIO_05 */
        PIN_62,        /*  34 - GPIO_07 */
        PIN_18,        /*  35 - GPIO_28 */
        PIN_21,        /*  36 - GPIO_25 */
        PIN_64,        /*  37 - GPIO_09 */
        PIN_17,        /*  38 - GPIO_24 */
        PIN_01,        /*  39 - GPIO_10 */
        PIN_02        /*  40 - GPIO_11 */
    };

    CC3200 pinout:
    http://www.ti.com/ods/images/SWAS032F/po_DEV3200_swas032.gif

    CC3200MOD pinout:

    http://www.ti.com/ods/images/SWRS166/CC3200MOD_Pin_Diagram.gif

    Any thoughts or opinions would be very welcome!

  13. So, in case anybody else is curious, I've got the answer to my own question.

    Rename your bin to "mcuimg.bin"

    In Uniflash, go to the System Files, find /sys/mcuimg.bin

    Click the BROWSE button for URL and navigate to your file.

    Mark Erase, Update, and Verify.

    Go back to Flash Setup and Control, click Program.

    Enjoy.

    I really have to say that this is fantastic.I'm going to see what functions I can duplicate from CCS this way.

×
×
  • Create New...