Jump to content

Bernard

Members
  • Content Count

    68
  • Joined

  • Last visited

About Bernard

  • Rank
    Level 1

Profile Information

  • Gender
    Male

Recent Profile Visitors

235 profile views
  1. Hi, Months ago I ordered this booster pack ( 2.2 240x320 LCD V2 )and so far I haven't used it. I would like to know if it is CC3200 compatible. I Dont want to plug it on cc3200 board, just wire it but I do not understand this BP pinout. Can someone help me Thanks and salutations.
  2. Bernard

    Energia bug in Blink without delay tutorial

    Hi, May be this help : http://playground.arduino.cc/Code/TimingRollover Salutations
  3. Hi, Ethernet example " EthernetWebServer " doesn't compile under Energia 013 here is error message : In file included from awebserver.ino:8:0: C:\Users\Nardo\energia-0101E0013\hardware\lm4f\libraries\Ethernet/Ethernet.h:12:28: error: redefinition of 'const IPAddress INADDR_NONE' In file included from C:\Users\Nardo\energia-0101E0013\hardware\lm4f\libraries\Ethernet/Ethernet.h:8:0, from awebserver.ino:8: C:\Users\Nardo\energia-0101E0013\hardware\lm4f\cores\lm4f/IPAddress.h:73:17: error: 'const IPAddress INADDR_NONE' previously declared here Under Energia012 it compiles and runs ok. Thank you and Salutations Bernard.
  4. Bernard

    TM4C129 +nRF24l01 web server problem

    I think it's true, although I added a 10uF cap, sometimes the program freeze when server get a client and need more power. I will try a 47uF. To be continued ... Salutations
  5. Bernard

    TM4C129 +nRF24l01 web server problem

    Hi, Finaly everything is ok .. a 10uF on the nRF24l01 breakout !!! Sorry for the inconvenience caused. Best regards Bernard
  6. Bernard

    TM4C129 +nRF24l01 web server problem

    @spirillis : thanks for replying. Yes Internet part works when I comment out Enrf24-related items. When I comment out //Ethernet.begin(mac, ip); //server.begin(); radio is ok and I get DHT22 values. Another clue, Resetting the TM4C129 board several times .. sometimes I cans see DHT22 values : copy of terminal with loop debug : Enrf24 radio transceiver status: DEEP SLEEP <1uA power consumption Loop begin <---- nada Enrf24 radio transceiver status: DEEP SLEEP <1uA power consumption Loop begin <---- nada Enrf24 radio transceiver status: DEEP SLEEP <1uA power consumption Loop begin 41.5---25.2 <----- good values miracle !!! if End Loop Loop begin salutations
  7. Bernard

    TM4C129 +nRF24l01 web server problem

    Hi, Sorry for my previous post, better to forget it . Here is another more clear I hope in order to explain my problem /* TM4C129 SPI module 1 */ #include <Ethernet.h> #include <Enrf24.h> #include <nRF24L01.h> #include <SPI.h> Enrf24 radio(PE_0,PE_2,PE_1); // CE, CSN, IRQ + SCK/MOSI/MISO ==> PB_5/PE_4/PE_5 const uint8_t rxaddr[] = { 0xF0,0xF0,0xF0,0xF0,0xE1 }; unsigned long prev_time; byte mac[] = { 0x00, 0x1A, 0xB6, 0x02, 0xB1, 0x27 }; IPAddress ip(192,168,0, 13); EthernetServer server(80); void setup(){ Serial.begin(115200); Serial.flush(); Ethernet.begin(mac, ip); server.begin(); SPI.setModule(1); SPI.begin(); SPI.setDataMode(SPI_MODE0); SPI.setBitOrder(1); radio.begin(); // Defaults 1Mbps, channel 0, max TX power dump_radio_status_to_serialport(radio.radioState()); radio.setRXaddress((void*)rxaddr); radio.enableRX(); // Start listening delay(200); } void loop(){ char inbuf[48]; delta_set(); Serial.println("Loop begin"); while (!radio.available(true)); //&& delta_get()<1000); Serial.println("before if"); if (radio.read(inbuf)) { Serial.println(inbuf); Serial.println("if"); } listenForEthernetClients(); Serial.println("End Loop"); } void listenForEthernetClients() { EthernetClient client = server.available(); if (client) { Serial.println("Got a client"); boolean currentLineIsBlank = true; while (client.connected()) { if (client.available()) { char c = client.read(); if (c == '\n' && currentLineIsBlank) { client.println(); client.print("degreesC,25"); // just for test client.print(", "); client.print("Humidity,60"); // idem client.print(", "); client.print("millibar,1018"); // idem break; } if (c == '\n') { currentLineIsBlank = true; } else if (c != '\r') { currentLineIsBlank = false; } } } delay(1); client.stop(); } } void dump_radio_status_to_serialport(uint8_t status) { Serial.print("Enrf24 radio transceiver status: "); switch (status) { case ENRF24_STATE_NOTPRESENT: Serial.println("NO TRANSCEIVER PRESENT"); break; case ENRF24_STATE_DEEPSLEEP: Serial.println("DEEP SLEEP <1uA power consumption"); break; case ENRF24_STATE_IDLE: Serial.println("IDLE module powered up w/ oscillators running"); break; case ENRF24_STATE_PTX: Serial.println("Actively Transmitting"); break; case ENRF24_STATE_PRX: Serial.println("Receive Mode"); break; default: Serial.println("UNKNOWN STATUS CODE"); } } void delta_set() { prev_time = millis(); } // TimeOut unsigned long delta_get() { unsigned long time; unsigned long delta; time = millis(); if (time < prev_time) { // TimeOut delta = 0xffffffff - prev_time + time + 1; } else { delta = time - prev_time; } return delta; } nRF24L01 alone works ok but when I add the Ethernet part I can't get received values. The loop freeze on while (!radio.available(true)); I don't know why and I am a bit lost. Thanks for help. Best regards Bernard
  8. Hi, I would like to centralize several RF sensors on TM4C129 and make a web server, so I write this simple sketch ( may be too simple) But, Serial.println("inbuf"); doesn't work and client.print(inbuf); works once. /* Tiva launchpad connected TM4C129 nRF24L01 RX SPI module 1 26/06/2014 */ #include <Ethernet.h> #include <Enrf24.h> #include <nRF24L01.h> #include <string.h> #include <SPI.h> byte mac[] = { 0x00, 0x1A, 0xB6, 0x02, 0xB1, 0x27 }; byte ip[] = { 192,168,0, 13 }; EthernetServer server(80); Enrf24 radio(PE_0,PE_2,PE_1); // CE, CSN, IRQ + SCK/MOSI/MISO ==> PB_5/PE_4/PE_5 const uint8_t rxaddr[] = { 0xF0,0xF0,0xF0,0xF0,0xE1 }; unsigned long prev_time; void setup() { Serial.begin(9600); Serial.flush(); Ethernet.begin(mac, ip); server.begin(); SPI.setModule(1); SPI.begin(); SPI.setDataMode(SPI_MODE0); SPI.setBitOrder(1); radio.begin(); // Defaults 1Mbps, channel 0, max TX power dump_radio_status_to_serialport(radio.radioState()); radio.setRXaddress((void*)rxaddr); radio.enableRX(); // Start listening delay(100); } //**************************** Main loop *************************************** void loop() { char inbuf[33]; delta_set(); Serial.println("Loop begin"); // debug while (!radio.available(true)&& delta_get()<1000); if (radio.read(inbuf)) { Serial.println("inbuf"); } //Listen to client (browser WEB) delay(100); EthernetClient client = server.available(); if (client) { boolean currentLineIsBlank = true; while (client.connected()) { if (client.available()) { // send a standard http response header client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println("Connection: close"); client.println(); client.println("<!DOCTYPE html>"); client.println("<html>"); client.println("<head>"); client.println("<title>Domotic</title>"); client.println("<meta http-equiv=\"refresh\" content=\"30\" >"); client.println("</head><body bgcolor=\"#000000\" text=\"#ffffff\" link=\"#0000ff\" vlink=\"#0000ff\" alink=\"#ff0000\">"); client.print("<h1>TM4C129 web server</h1><h2>Temperature</h2>"); client.print("Humidity and temperature = "); client.print(inbuf); client.print("<br>"); client.println("(update 30s)"); client.println("<br>"); client.println("</html>"); client.stop(); } } } Serial.println("End loop"); // debug } //************************** End main loop ***************************************** void delta_set() { prev_time = millis(); } // TimeOut unsigned long delta_get() { unsigned long time; unsigned long delta; time = millis(); if (time < prev_time) { // TimeOut delta = 0xffffffff - prev_time + time + 1; } else { delta = time - prev_time; } return delta; } void dump_radio_status_to_serialport(uint8_t status) { Serial.print("Enrf24 radio transceiver status: "); switch (status) { case ENRF24_STATE_NOTPRESENT: Serial.println("NO TRANSCEIVER PRESENT"); break; case ENRF24_STATE_DEEPSLEEP: Serial.println("DEEP SLEEP <1uA power consumption"); break; case ENRF24_STATE_IDLE: Serial.println("IDLE module powered up w/ oscillators running"); break; case ENRF24_STATE_PTX: Serial.println("Actively Transmitting"); break; case ENRF24_STATE_PRX: Serial.println("Receive Mode"); break; default: Serial.println("UNKNOWN STATUS CODE"); } } Any help would be appreciated. Salutations. Bernard
  9. Bernard

    TM4C129 nRF24L01 RX working example

    Hi again, I forgot to post the TX side : /* MSP 430g2553 TX DHT22 25/06/2014 */ #include <Enrf24.h> #include <nRF24L01.h> #include <string.h> #include <SPI.h> #include <DHT22_430.h> #define DHTPIN P1_4 DHT22 mySensor(DHTPIN); Enrf24 radio(P2_0, P2_1, P2_2); // P2.0=CE, P2.1=CSN, P2.2=IRQ const uint8_t txaddr[] = { 0xF0,0xF0,0xF0,0xF0,0xE1 }; boolean flag = 0; void dump_radio_status_to_serialport(uint8_t); void setup() { Serial.begin(9600); SPI.begin(); SPI.setDataMode(SPI_MODE0); SPI.setBitOrder(1); // MSB-first mySensor.begin(); radio.begin(); // Defaults 1Mbps, channel 0, max TX power //radio.setCRC(1,1); radio.setTXaddress((void*)txaddr); } void loop() { char str[16]; long h = mySensor.humidityX10(); long t = mySensor.temperatureX10(); flag = mySensor.get(); if (!flag) { radio.print("DHT error"); } else{ sprintf(str, "%ld",h/10); radio.print(str); radio.print("."); sprintf(str, "%ld",h%10); radio.print(str); radio.print("---"); sprintf(str, "%ld",t/10); radio.print(str); radio.print("."); sprintf(str, "%ld",t%10); radio.print(str); radio.flush(); // Force transmit (don't wait for any more data) } delay(1000); } My project is to centrally manage several rf sensors on Tiva connected board and make a web server. I have spent many time to add the Ethernet part in the loop and so far no success ... any help would be appreciate Salutations Bernard
  10. Hi, Here is a working example TM4C129 using Enrf24 library /* Tiva launchpad connected TM4C129 nRF24L01 RX SPI module 2 25/06/2014 */ #include <Enrf24.h> #include <nRF24L01.h> #include <string.h> #include <SPI.h> Enrf24 radio(PE_0,PE_2,PE_1); // CE, CSN, IRQ + SCK/MOSI/MISO ==> PD_3/PD_0/PD_1 const uint8_t rxaddr[] = { 0xF0,0xF0,0xF0,0xF0,0xE1 }; unsigned long prev_time; void setup() { Serial.begin(9600); Serial.flush(); SPI.setModule(2); SPI.begin(); SPI.setDataMode(SPI_MODE0); SPI.setBitOrder(1); radio.begin(); // Defaults 1Mbps, channel 0, max TX power dump_radio_status_to_serialport(radio.radioState()); radio.setRXaddress((void*)rxaddr); radio.enableRX(); // Start listening delay(100); } void loop() { char inbuf[33]; delta_set(); while (!radio.available(true)&& delta_get()<1000); if (radio.read(inbuf)) { Serial.println(inbuf); } } void delta_set() { prev_time = millis(); } // TimeOut unsigned long delta_get() { unsigned long time; unsigned long delta; time = millis(); if (time < prev_time) { // TimeOut delta = 0xffffffff - prev_time + time + 1; } else { delta = time - prev_time; } return delta; } void dump_radio_status_to_serialport(uint8_t status) { Serial.print("Enrf24 radio transceiver status: "); switch (status) { case ENRF24_STATE_NOTPRESENT: Serial.println("NO TRANSCEIVER PRESENT"); break; case ENRF24_STATE_DEEPSLEEP: Serial.println("DEEP SLEEP <1uA power consumption"); break; case ENRF24_STATE_IDLE: Serial.println("IDLE module powered up w/ oscillators running"); break; case ENRF24_STATE_PTX: Serial.println("Actively Transmitting"); break; case ENRF24_STATE_PRX: Serial.println("Receive Mode"); break; default: Serial.println("UNKNOWN STATUS CODE"); } } TX is MSP430 + DHT22 sending humidity and temperature Salutations Bernard
  11. Bernard

    My first attempt TM4C129

    Hi, Thank you energia for reply. I just tried your example under Firefox ubuntu and it perfectly works. I don't know why it doesn't work under Firefox windows .. not a big problem. Salutations
  12. Hi everyone, I have just received TM4C129 evaluation board and test with this program I have found on google. #include <Ethernet.h> // MAC address from Ethernet shield sticker under board byte mac[] = { 0x00, 0x1A, 0xB6, 0x02, 0xB1, 0x27 }; IPAddress ip(192,168, 0, 13); // IP address, may need to change depending on network EthernetServer server(80); // create a server at port 80 void setup() { Ethernet.begin(mac, ip); // initialize Ethernet device server.begin(); // start to listen for clients } void loop() { EthernetClient client = server.available(); // try to get client if (client) { // got client? boolean currentLineIsBlank = true; while (client.connected()) { if (client.available()) { // client data available to read char c = client.read(); // read 1 byte (character) from client // last line of client request is blank and ends with \n // respond to client only after last line received if (c == '\n' && currentLineIsBlank) { // send a standard http response header client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println("Connection: close"); client.println(); // send web page client.println("<!DOCTYPE html>"); client.println("<html>"); client.println("<head>"); client.println("<title>Tiva Web Page</title>"); client.println("</head>"); client.println("<body>"); client.println("<h1>Hello from Tiva connected!</h1>"); client.println("<p>A web page from the Tiva server</p>"); client.println("</body>"); client.println("</html>"); break; } // every line of text received from the client ends with \r\n if (c == '\n') { // last character on line of received text // starting new line with next character read currentLineIsBlank = true; } else if (c != '\r') { // a text character was received from client currentLineIsBlank = false; } } // end if (client.available()) } // end while (client.connected()) delay(1); // give the web browser time to receive the data client.stop(); // close the connection } // end if (client) } When I connect the server for the first time with firefox, everything is ok, but after no success. I have to reset LM4C129. Do I miss something to make server permanently listening ? Thank you for help Salutations
  13. Bernard

    MSP430G2553 and Rotary encoder

    Hi, Thank you very much Chicken.. it works perfectly Bernard
×