Jump to content

Search the Community

Showing results for tags 'Ethernet'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks

Calendars

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests


Sparkfun


Github

Found 23 results

  1. Hi all! I started a tcp server on my TM4C1294. At the beginning, my code works. Then I get new ip, dns, gateway and subnet mask from serial port. I want to restart my server with the new ip,dns,gw and subnet values. For this reason, I tried the below code... Unfortunately, the program stuck in "Ethernet.begin". Is there anything in order to restart the ethernet and tcp server with new ip? //LIBRARIES #include <stdint.h> #include <stdbool.h> //#include "inc/hw_memmap.h" //#include "driverlib/debug.h" #include <Ethernet.h> #include <Wire.h> //#include "driverlib/pin_map.h" //#include "driverlib/gpio.h" //#include "driverlib/sysctl.h" //#include "driverlib/i2c.h" //#include "inc/hw_i2c.h" //#include "inc/hw_types.h" ////#include "XIO.h" //#include "string.h" byte mac[] = { 0x00, 0x1A, 0xB6, 0x02, 0xF0, 0x80 }; int PortNumber = 1213; byte ip_arr[] = { 77, 99, 0, 66 }; byte dns_arr[] = { 77, 99, 1, 1 }; byte gw_arr[] = { 77, 99, 1, 1 }; byte mask_arr[] = { 255, 0, 0, 0 }; EthernetServer server = EthernetServer(PortNumber); void setup() { Serial.begin(19200); /*ip = ip_arr; dns = dns_arr; gw = gw_arr; mask = mask_arr;*/ Ethernet.begin(mac, ip_arr, dns_arr, gw_arr, mask_arr); server.begin(); delay(100); } int serial_read_data[25]; int serial_index = 0; void get_serial_data(String serial_data) { unsigned char incomingByte; char *sr_data = &serial_data[0]; char str[40]; //char *tab2 = new char [serial_data.length()+1]; byte ip1 = 0; byte ip2 = 0; byte ip3 = 0; byte ip4 = 0; if(serial_data == "ver" ) { Serial.println("\nVer: 1.01"); } else if(serial_data == "show" ) { Serial.print("IP = "); Serial.println(Ethernet.localIP()); Serial.print("Subnet = "); Serial.println(Ethernet.subnetMask()); Serial.print("Gateway = "); Serial.println(Ethernet.gatewayIP()); Serial.print("Port = "); Serial.println(PortNumber, DEC); } else if(serial_data == "U" ) { //Ethernet.stop(); Serial.println("\nserver rebooting-1"); server.available().stop(); Serial.println("\nserver rebooting-2"); delay(100); //try this!!!! SysCtlReset(); delay(100); Ethernet.begin(mac, ip_arr, dns_arr, gw_arr, mask_arr);//STUCKS HERE!!!!!!!!! delay(100); Serial.println("\nserver rebooting-3"); server.begin(); Serial.println("\n server rebooted..."); Serial.print("IP = "); Serial.println(Ethernet.localIP()); Serial.print("Subnet = "); Serial.println(Ethernet.subnetMask()); Serial.print("Gateway = "); Serial.println(Ethernet.gatewayIP()); Serial.print("Port = "); Serial.println(PortNumber, DEC); } else { //char serial_data[serial_data.length()]; //strcpy (tab2, serial_data.c_str()); memset(str, '\0', sizeof(str)); strncpy ( str, sr_data, 3); if(strcmp(str, "IP=") == 0) { Serial.println("\nIP Changing!!"); ip1 = 100 * (sr_data[3] - 0x30) + 10 * (sr_data[4] - 0x30) + (sr_data[5] - 0x30); ip2 = 100 * (sr_data[7] - 0x30) + 10 * (sr_data[8] - 0x30) + (sr_data[9] - 0x30); ip3 = 100 * (sr_data[11] - 0x30) + 10 * (sr_data[12] - 0x30) + (sr_data[13] - 0x30); ip4 = 100 * (sr_data[15] - 0x30) + 10 * (sr_data[16] - 0x30) + (sr_data[17] - 0x30); Serial.println(ip1, DEC); Serial.println(ip2, DEC); Serial.println(ip3, DEC); Serial.println(ip4, DEC); ip_arr[0] = ip1; ip_arr[1] = ip2; ip_arr[2] = ip3; ip_arr[3] = ip4; } else if(strcmp(str, "SN=") == 0) { Serial.println("\nSubnet Changing!"); ip1 = 100 * (sr_data[3] - 0x30) + 10 * (sr_data[4] - 0x30) + (sr_data[5] - 0x30); ip2 = 100 * (sr_data[7] - 0x30) + 10 * (sr_data[8] - 0x30) + (sr_data[9] - 0x30); ip3 = 100 * (sr_data[11] - 0x30) + 10 * (sr_data[12] - 0x30) + (sr_data[13] - 0x30); ip4 = 100 * (sr_data[15] - 0x30) + 10 * (sr_data[16] - 0x30) + (sr_data[17] - 0x30); Serial.println(ip1, DEC); Serial.println(ip2, DEC); Serial.println(ip3, DEC); Serial.println(ip4, DEC); mask_arr[0] = ip1; mask_arr[1] = ip2; mask_arr[2] = ip3; mask_arr[3] = ip4; } else if(strcmp(str, "GW=") == 0) { Serial.println("\nGW Changing!!"); ip1 = 100 * (sr_data[3] - 0x30) + 10 * (sr_data[4] - 0x30) + (sr_data[5] - 0x30); ip2 = 100 * (sr_data[7] - 0x30) + 10 * (sr_data[8] - 0x30) + (sr_data[9] - 0x30); ip3 = 100 * (sr_data[11] - 0x30) + 10 * (sr_data[12] - 0x30) + (sr_data[13] - 0x30); ip4 = 100 * (sr_data[15] - 0x30) + 10 * (sr_data[16] - 0x30) + (sr_data[17] - 0x30); Serial.println(ip1, DEC); Serial.println(ip2, DEC); Serial.println(ip3, DEC); Serial.println(ip4, DEC); gw_arr[0] = ip1; gw_arr[1] = ip2; gw_arr[2] = ip3; gw_arr[3] = ip4; } else { strncpy ( str, sr_data, 5); if(strcmp(str, "Port=") == 0) { Serial.println("\nPort Changing!!"); PortNumber = 10000 * (sr_data[5] - 0x30) + 1000 * (sr_data[6] - 0x30) + 100 * (sr_data[7] - 0x30) + 10 * (sr_data[8] - 0x30) + (sr_data[9] - 0x30); Serial.println(PortNumber, DEC); } } } } //int i=0; void loop() { /* Serial.println("\nI2C SEND"); delay(100); uint32_t pui32DataTx[3]; I2CMasterSlaveAddrSet(I2C0_BASE, 0x20, false); Serial.println("\nMASTER SLAVE ADdRES SET"); delay(100); pui32DataTx[0] = 0x80 | 0x08; pui32DataTx[1] = 0x01; int i; for(i = 0; i < 2; i++){ I2CMasterDataPut(I2C0_BASE, pui32DataTx[i]); Serial.println("\ncount: "); Serial.println(i); I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_SINGLE_SEND); delay(100); while(I2CMasterBusBusy(I2C0_BASE)); //Loop until the bus is no longer busy Serial.println("\neheheef: "); Serial.println(i); }*/ if (Serial.available() > 0) { // read the incoming byte: String incomingByte = Serial.readString(); // say what you got: get_serial_data(incomingByte); } }
  2. After sometime my "TM4C129EXL" card's ethernet server stops responding to clients. When i pause debugger in CCS, i found out that in "Tcp.c" file "tcp_slowtmr" function there is an infinity loop. Whole function => /** * Called every 500 ms and implements the retransmission timer and the timer that * removes PCBs that have been in TIME-WAIT for enough time. It also increments * various timers such as the inactivity timer in each PCB. * * Automatically called from tcp_tmr(). */ void tcp_slowtmr(void) { struct tcp_pcb *pcb, *prev; u16_t eff_wnd; u8_t pcb_remove; /* flag if a PCB should be removed */ u8_t pcb_reset; /* flag if a RST should be sent when removing */ err_t err; err = ERR_OK; ++tcp_ticks; ++tcp_timer_ctr; tcp_slowtmr_start: /* Steps through all of the active PCBs. */ prev = NULL; pcb = tcp_active_pcbs; if (pcb == NULL) { LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: no active pcbs\n")); } while (pcb != NULL) { LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: processing active pcb\n")); LWIP_ASSERT("tcp_slowtmr: active pcb->state != CLOSED\n", pcb->state != CLOSED); LWIP_ASSERT("tcp_slowtmr: active pcb->state != LISTEN\n", pcb->state != LISTEN); LWIP_ASSERT("tcp_slowtmr: active pcb->state != TIME-WAIT\n", pcb->state != TIME_WAIT); if (pcb->last_timer == tcp_timer_ctr) { /* skip this pcb, we have already processed it */ pcb = pcb->next; continue; } pcb->last_timer = tcp_timer_ctr; pcb_remove = 0; pcb_reset = 0; if (pcb->state == SYN_SENT && pcb->nrtx == TCP_SYNMAXRTX) { ++pcb_remove; LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max SYN retries reached\n")); } else if (pcb->nrtx == TCP_MAXRTX) { ++pcb_remove; LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max DATA retries reached\n")); } else { if (pcb->persist_backoff > 0) { /* If snd_wnd is zero, use persist timer to send 1 byte probes * instead of using the standard retransmission mechanism. */ pcb->persist_cnt++; if (pcb->persist_cnt >= tcp_persist_backoff[pcb->persist_backoff-1]) { pcb->persist_cnt = 0; if (pcb->persist_backoff < sizeof(tcp_persist_backoff)) { pcb->persist_backoff++; } tcp_zero_window_probe(pcb); } } else { /* Increase the retransmission timer if it is running */ if(pcb->rtime >= 0) { ++pcb->rtime; } if (pcb->unacked != NULL && pcb->rtime >= pcb->rto) { /* Time for a retransmission. */ LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_slowtmr: rtime %"S16_F " pcb->rto %"S16_F"\n", pcb->rtime, pcb->rto)); /* Double retransmission time-out unless we are trying to * connect to somebody (i.e., we are in SYN_SENT). */ if (pcb->state != SYN_SENT) { pcb->rto = ((pcb->sa >> 3) + pcb->sv) << tcp_backoff[pcb->nrtx]; } /* Reset the retransmission timer. */ pcb->rtime = 0; /* Reduce congestion window and ssthresh. */ eff_wnd = LWIP_MIN(pcb->cwnd, pcb->snd_wnd); pcb->ssthresh = eff_wnd >> 1; if (pcb->ssthresh < (pcb->mss << 1)) { pcb->ssthresh = (pcb->mss << 1); } pcb->cwnd = pcb->mss; LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_slowtmr: cwnd %"U16_F " ssthresh %"U16_F"\n", pcb->cwnd, pcb->ssthresh)); /* The following needs to be called AFTER cwnd is set to one mss - STJ */ tcp_rexmit_rto(pcb); } } } /* Check if this PCB has stayed too long in FIN-WAIT-2 and FIN_WAIT_1 */ if (pcb->state == FIN_WAIT_2 || pcb->state == FIN_WAIT_1) { /* If this PCB is in FIN_WAIT_2 because of SHUT_WR don't let it time out. */ if (pcb->flags & TF_RXCLOSED) { /* PCB was fully closed (either through close() or SHUT_RDWR): normal FIN-WAIT timeout handling. */ if ((u32_t)(tcp_ticks - pcb->tmr) > TCP_FIN_WAIT_TIMEOUT / TCP_SLOW_INTERVAL) { ++pcb_remove; LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in FIN-WAIT\n")); } } } /* Check if KEEPALIVE should be sent */ if(ip_get_option(pcb, SOF_KEEPALIVE) && ((pcb->state == ESTABLISHED) || (pcb->state == CLOSE_WAIT))) { if((u32_t)(tcp_ticks - pcb->tmr) > (pcb->keep_idle + TCP_KEEP_DUR(pcb)) / TCP_SLOW_INTERVAL) { LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: KEEPALIVE timeout. Aborting connection to %"U16_F".%"U16_F".%"U16_F".%"U16_F".\n", ip4_addr1_16(&pcb->remote_ip), ip4_addr2_16(&pcb->remote_ip), ip4_addr3_16(&pcb->remote_ip), ip4_addr4_16(&pcb->remote_ip))); ++pcb_remove; ++pcb_reset; } else if((u32_t)(tcp_ticks - pcb->tmr) > (pcb->keep_idle + pcb->keep_cnt_sent * TCP_KEEP_INTVL(pcb)) / TCP_SLOW_INTERVAL) { tcp_keepalive(pcb); pcb->keep_cnt_sent++; } } /* If this PCB has queued out of sequence data, but has been inactive for too long, will drop the data (it will eventually be retransmitted). */ #if TCP_QUEUE_OOSEQ if (pcb->ooseq != NULL && (u32_t)tcp_ticks - pcb->tmr >= pcb->rto * TCP_OOSEQ_TIMEOUT) { tcp_segs_free(pcb->ooseq); pcb->ooseq = NULL; LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_slowtmr: dropping OOSEQ queued data\n")); } #endif /* TCP_QUEUE_OOSEQ */ /* Check if this PCB has stayed too long in SYN-RCVD */ if (pcb->state == SYN_RCVD) { if ((u32_t)(tcp_ticks - pcb->tmr) > TCP_SYN_RCVD_TIMEOUT / TCP_SLOW_INTERVAL) { ++pcb_remove; LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in SYN-RCVD\n")); } } /* Check if this PCB has stayed too long in LAST-ACK */ if (pcb->state == LAST_ACK) { if ((u32_t)(tcp_ticks - pcb->tmr) > 2 * TCP_MSL / TCP_SLOW_INTERVAL) { ++pcb_remove; LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in LAST-ACK\n")); } } /* If the PCB should be removed, do it. */ if (pcb_remove) { struct tcp_pcb *pcb2; tcp_err_fn err_fn; void *err_arg; tcp_pcb_purge(pcb); /* Remove PCB from tcp_active_pcbs list. */ if (prev != NULL) { LWIP_ASSERT("tcp_slowtmr: middle tcp != tcp_active_pcbs", pcb != tcp_active_pcbs); prev->next = pcb->next; } else { /* This PCB was the first. */ LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_active_pcbs", tcp_active_pcbs == pcb); tcp_active_pcbs = pcb->next; } if (pcb_reset) { tcp_rst(pcb->snd_nxt, pcb->rcv_nxt, &pcb->local_ip, &pcb->remote_ip, pcb->local_port, pcb->remote_port); } err_fn = pcb->errf; err_arg = pcb->callback_arg; pcb2 = pcb; pcb = pcb->next; memp_free(MEMP_TCP_PCB, pcb2); tcp_active_pcbs_changed = 0; TCP_EVENT_ERR(err_fn, err_arg, ERR_ABRT); if (tcp_active_pcbs_changed) { goto tcp_slowtmr_start; } } else { /* get the 'next' element now and work with 'prev' below (in case of abort) */ prev = pcb; pcb = pcb->next; /* We check if we should poll the connection. */ ++prev->polltmr; if (prev->polltmr >= prev->pollinterval) { prev->polltmr = 0; LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: polling application\n")); tcp_active_pcbs_changed = 0; TCP_EVENT_POLL(prev, err); if (tcp_active_pcbs_changed) { goto tcp_slowtmr_start; } /* if err == ERR_ABRT, 'prev' is already deallocated */ if (err == ERR_OK) { tcp_output(prev); } } } } /* Steps through all of the TIME-WAIT PCBs. */ prev = NULL; pcb = tcp_tw_pcbs; while (pcb != NULL) { LWIP_ASSERT("tcp_slowtmr: TIME-WAIT pcb->state == TIME-WAIT", pcb->state == TIME_WAIT); pcb_remove = 0; /* Check if this PCB has stayed long enough in TIME-WAIT */ if ((u32_t)(tcp_ticks - pcb->tmr) > 2 * TCP_MSL / TCP_SLOW_INTERVAL) { ++pcb_remove; } /* If the PCB should be removed, do it. */ if (pcb_remove) { struct tcp_pcb *pcb2; tcp_pcb_purge(pcb); /* Remove PCB from tcp_tw_pcbs list. */ if (prev != NULL) { LWIP_ASSERT("tcp_slowtmr: middle tcp != tcp_tw_pcbs", pcb != tcp_tw_pcbs); prev->next = pcb->next; } else { /* This PCB was the first. */ LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_tw_pcbs", tcp_tw_pcbs == pcb); tcp_tw_pcbs = pcb->next; } pcb2 = pcb; pcb = pcb->next; memp_free(MEMP_TCP_PCB, pcb2); } else { prev = pcb; pcb = pcb->next; } } } Infinity loop in while => /* Steps through all of the TIME-WAIT PCBs. */ prev = NULL; pcb = tcp_tw_pcbs; while (pcb != NULL) { LWIP_ASSERT("tcp_slowtmr: TIME-WAIT pcb->state == TIME-WAIT", pcb->state == TIME_WAIT); pcb_remove = 0; /* Check if this PCB has stayed long enough in TIME-WAIT */ if ((u32_t)(tcp_ticks - pcb->tmr) > 2 * TCP_MSL / TCP_SLOW_INTERVAL) { ++pcb_remove; } /* If the PCB should be removed, do it. */ if (pcb_remove) { struct tcp_pcb *pcb2; tcp_pcb_purge(pcb); /* Remove PCB from tcp_tw_pcbs list. */ if (prev != NULL) { LWIP_ASSERT("tcp_slowtmr: middle tcp != tcp_tw_pcbs", pcb != tcp_tw_pcbs); prev->next = pcb->next; } else { /* This PCB was the first. */ LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_tw_pcbs", tcp_tw_pcbs == pcb); tcp_tw_pcbs = pcb->next; } pcb2 = pcb; pcb = pcb->next; memp_free(MEMP_TCP_PCB, pcb2); } else { prev = pcb; pcb = pcb->next; } } } How can i fix this ?
  3. Fred

    MSP432E4

    I just spotted these and couldn't find any other thread about them. Headline is it an MSP432 with Ethernet, USB and CAN. http://www.ti.com/microcontrollers/simplelink-mcus/msp432/overview/msp432e4.html http://www.ti.com/product/msp432e401y http://www.ti.com/product/msp432e411y Launchpad: http://www.ti.com/tool/msp-exp432e401y
  4. Hi all, I'm just starting with the TM4C1294XL. I'm graduating from an Arduino mega that just doesn't have the speed I need in processing the Ethernet buffer. Can someone tell me how big the Ethernet receive buffer is when using energia? I've done calculations and I will be receiving about 3.2KB of information 10 to 20 times per second. This I have to process before the next batch is sent. So, I'm waiting for my new board to arrive, and I'm trying to do what I can to get ready. Thanks for any input. Jim
  5. Jetfire

    Library for Wiznet 5100

    Hi I am a newbie to MSP430 have coded on AVR and Arduino and trying out MSP for thr first time. Currently working on a project involving keypad, LCD, Ethernet. I have managed to find libraries of keypad and LCD and they seems to be working. But there is very few resources of ethernet and could not find anything. i have seen a post regarding W5200 but i unable to understand it, also RobG booster pack and library for W550 is great but i dont have the module and is out of stock. If anybody have any links on how to create the library for a newbie would be great and if they have a library for lets say Web client it would be awesome Thanks
  6. Jetfire

    Library for Wiznet 5100

    Hi I am a newbie to MSP430 have coded on AVR and Arduino and trying out MSP for thr first time. Currently working on a project involving keypad, LCD, Ethernet. I have managed to find libraries of keypad and LCD and they seems to be working. But there is very few resources of ethernet and could not find anything. i have seen a post regarding W5200 but i unable to understand it, also RobG booster pack and library for W550 is great but i dont have the module and is out of stock. If anybody have any links on how to create the library for a newbie would be great and if they have a library for lets say Web client it would be awesome Thanks
  7. It would be really awesome for my project if I could update code over Ethernet, instead of USB for my Tiva C connected. I've tried the latest version of the LM Flash Utility (Build 1613) and cannot seem to connect to the Tiva C over Ethernet with the utility. I have a MAC and IP set on my board using the Energia Ethernet UDP library and can verify them with a ping and look at my laptop's ARP table, but I am unsure if this is enough to satisfy the needs of the LM Flash Utility. I was hoping that the functionality would be supported "behind the scenes" in Energia, but that does not seem to be the case. Is there a TI TivaWare/StarterWare function that can be easily called to gain this functionality? Has anyone here had any luck trying to program the Tiva C connected over Ethernet?
  8. Hello, I need help sending an Ethernet raw socket through my EK-TM4C1294XL (http://www.ti.com/tool/ek-tm4c1294xl). Here is what i have done so far: -> Using and modifing some NDK examples, but the problem is that i want a code in C/C++, not using a whole operating system (TI-RTOS SYS/BIOS); -> Including NDK libraries for use of it's functions and not installing the SYS/BIOS, however i am having lots of dependencies errors; -> Using Tiva C Series Ethernet examples, but they use the lwip TCP/IP protocol stack, i'm trying to send a raw Ethernet socket only; -> Using Energia Ethernet library, stll could not isolate the code sending only a raw Ethernet socket; -> Using W5100 Ethernet Shield library, however i could not manage to get Ethernet output (http://forum.43oh.com/topic/9858-energia-library-wiznet-w5100w5200w5500/). If someone could provide any tips or other implementations, i would appreciate very much. Thank you.
  9. Hi, As it seems to work on MSP430 device like MSP430F5529, I share it here too : http://forum.43oh.com/topic/9858-energia-library-wiznet-w5100w5200w5500/ Ethernet_Wiznet.zip
  10. Hi all, It was a real pain in the ass to find information about interfacing LP + Wiznet ethernet chip with energia so I'm here to share my work. I was looking for a library for ethernet chips from Wiznet (W5100,W5200,W5500) for TivaC series LP. The first problem I met was that as TM4C129 LP already has an ethernet.h library, I simply could not copy a new ethernet.h library for non-ethernet Ethernet_Wiznet.zip
  11. Hi, I am using the web client demo to send an HTTP GET request to a web server to read the data in json format. However the web server returns an error code 301 page moved error. How do I redirect my request to the new location? Does the ethernet library for TIVA support SSL HTTP GET requests?
  12. khm

    Modbus TCP/IP

    0down votefavorite Hi, I am trying to implement Modbus TCP on TIVA 1294 using the following code. I am using a modbus slave simulator on a pc to check the following code. However, the code doesn't seem to be working. I have downloaded the code & the libraries fromhttp://myarduinoprojects.com/modbus.html. Please suggest me corrections if necessary. Also is there another working example available for modbus tcp/ip for ethernet on TIVA energia? Please guide. #include <SPI.h> #include <Ethernet.h> #include "MgsModbus.h" MgsModbus Mb; int inByte = 0; // incoming serial byte // Ethernet settings (depending on MAC and Local network) byte mac[] = {0x00, 0x1A, 0xB6, 0x02, 0xD1, 0x14 }; IPAddress ip(192, 168, 0, 35); void setup() { // serial setup Serial.begin(9600); Serial.println("Serial interface started"); // initialize the ethernet device Ethernet.begin(mac, ip); // start etehrnet interface Serial.println("Ethernet interface started"); // print your local IP address: Serial.print("My IP address: "); for (byte thisByte = 0; thisByte < 4; thisByte++) { // print the value of each byte of the IP address: Serial.print(Ethernet.localIP()[thisByte], DEC); Serial.print("."); } Serial.println(); // slave address Mb.remSlaveIP = (192,168,0,1); // Fill MbData // Mb.SetBit(0,false); Mb.MbData[0] = 1; Mb.MbData[1] = 2; Mb.MbData[2] = 3; Mb.MbData[3] = 4; Mb.MbData[4] = 5; Mb.MbData[5] = 6; Mb.MbData[6] = 0; Mb.MbData[7] = 0; Mb.MbData[8] = 0; Mb.MbData[9] = 0; Mb.MbData[10] = 0; Mb.MbData[11] = 0; // print MbData for (int i=0;i<12;i++) { Serial.print("address: "); Serial.print(i); Serial.print("Data: "); Serial.println(Mb.MbData); } // print menu Serial.println("0 - print the first 12 words of the MbData space"); Serial.println("1 - FC 1 - read the first 5 coils from the slave and store them in the lower byte of MbData[1]"); Serial.println("2 - FC 2 - read the first 5 discrete inputs from the slave and store them in the higer of the MbData[1]"); Serial.println("3 - FC 3 - read the first 5 registers from the slave and store them in MbData[3..7"); Serial.println("4 - FC 4 - read the first 5 input registers from the slave and store them in MbData[8..12]"); Serial.println("5 - FC 5 - write coil 0 of the slave with the bit valeu of MbData[0.0]"); Serial.println("6 - FC 6 - write register 0 of the slave with MbData[2]"); Serial.println("7 - FC 15 - write 5 coils of the slave starting with coil 0 with GetBit(16..20"); Serial.println("8 - Fc 16 - write 5 registers of the slave starting on register 0 with MbData[0..4]"); Serial.println(Mb.remSlaveIP); } void loop() { if (Serial.available() > 0) { // get incoming byte: inByte = Serial.read(); if (inByte == '0') { // print MbData for (int i=0;i<12;i++) { Serial.print("address: "); Serial.print(i); Serial.print("Data: "); Serial.println(Mb.MbData); } } if (inByte == '1') {Mb.Req(MB_FC_READ_COILS, 6,6,6);} // 1 // ref, count, pos if (inByte == '2') {Mb.Req(MB_FC_READ_DISCRETE_INPUT, 6,6,6);} // 2 if (inByte == '3') {Mb.Req(MB_FC_READ_REGISTERS, 6,6,6);} // 3 if (inByte == '4') {Mb.Req(MB_FC_READ_INPUT_REGISTER, 6,6,6);} // 4 if (inByte == '5') {Mb.Req(MB_FC_WRITE_COIL, 0,0,0);} // 5 // count can be x if (inByte == '6') {Mb.Req(MB_FC_WRITE_REGISTER, 7,0,0);} // 6 // count can be x if (inByte == '7') {Mb.Req(MB_FC_WRITE_MULTIPLE_COILS, 0,6,0);} // 15 if (inByte == '8') {Mb.Req(MB_FC_WRITE_MULTIPLE_REGISTERS, 0,6,0);} // 16 } Mb.MbmRun(); // Mb.MbsRun(); } Thanks.
  13. Hi , I have written a code for ethernet client using TM4c1294NCPDT launchpad and I am sending data to a server at api.pushingbox.com. The code sends data to the server after every 15 seconds, It works all the time, however sometimes suddenly the ethernet data transfer hangs, the microcontroller does not hang. Below is the void loop() I have used.Please help. void loop(){ kemasData(); //packing GET query with data Serial.println("connecting..."); if (client.connect(server, 80)) { sendData(); // koneksi = true; //connected = true u.count++; Serial.println(length); length = 0; EEPROM.write(0,u.b[0]); EEPROM.write(1,u.b[1]); Serial.println("conn serv"); } else{ Serial.println("connection failed"); } // loop while(client.connected()){ while (client.available()) { char c = client.read(); //save http header to c Serial.print(c); //print http header to serial monitor } //Serial.print("-"); } if (!client.connected()) { Serial.println(); Serial.println("disconnecting."); Serial.print("Count :"); Serial.println(u.count); //print sent value to serial monitor client.stop(); Serial.println("Client Stopped"); // koneksi = false; Serial.println("koneksi = false"); data = ""; //data reset } delay(15000); // interval } When I check the serial port the code hangs at conn serv printed above.
  14. I am using TM4C129 LaunchPad for an Industrial IoT product. We want to have a web server running on it. I am looking into this example of setting up the IP address. To do it this way, every time you join a new network, you have to change the code for a different IP address. Is there a way to avoid this problem? Any example of how can I change the IP address automatically as soon as it joins a a new network? I believe that the TivaWare provided example enet_io for the TM4C129x board does what I am looking for. But I would like an example in Energia. Can you please help?
  15. Buy: The 43oh Store or Rob's Tindie Store. The newest version of the Ethernet BoosterPack is based on the newest chip from WIZnet, W5500. P1.5 - SCLK P1.6 - MISO P1.7 - MOSI P2.3 - /CS P2.4 - /INT P2.5 - /RST Configuration jumpers are on the bottom, PMODE1-PMODE3, LINK LED, and ACT LED. LED jumpers control which LEDs are used, on board or socket. Available on Tindie.
  16. Hi, I have a Mac desktop app that connects to a Connected Launchpad via USB serial. I decided to try to add ethernet port connection. I got tantalizing close but no cigar! I've been stuck on this for a week now so I need help. I had no problems adding the Ethernet.h library except for something very weird trying to do a conditional import. I have been using directives to compile for either the LaunchPad or the Connected LaunchPad: #ifdef PART_TM4C1294NCPDT // Connected LaunchPad #include "Ethernet.h" #elif defined( PART_LM4F120H5QR ) // LaunchPad #endif This seems to have been working, but it doesn't work for the above code. I have to comment out the #include "Ethernet.h" to compile for the EX-TM4C123GXL, but this is only a minor inconvenience. I set up a Telnet socket and was able to connect to it using the Unix Telnet program. I could connect, disconnect and reconnect, but the server does not recognize the disconnection. The client.connected() function continues to return true so I only get my sign message with the first connection. Still, I thought I was ready to go so I added NSStream to my app. It could connect and exchange a few messages before giving me a Stream Code 54: The operation couldnz6MainEthernet.ino
  17. WIZpix is an internet enabled RGB pixel controller with built in PoE. WIZpix uses W5500 internet appliance to connect to internet and MSP430F5172 MCU to control RGB pixels. Built-in DC/DC converter allows use of PoE, which eliminates need for directly connected power supply, ability to place controller far away from the outlet, and use of only one inexpensive CAT-5 cable. It
  18. Hi All, I added ethernet library to Energia. Though Arduino library supports ethernet function, Energia doesn't provide any library for ethernet yet. So, I tried to add ethernet library for arduino onto Energia IDE. Finally, I did it and examples of ethernet library for arduino work well. But as MSP4302553 has less SRAM memory than arduino Uno, you have to make some serial.print() sentence as comment. Anyway, if anybody want to update this ethernet library, feel free do that. As .zip file is too big, I'll post it on Github and share to all of you as soon as possible. Thank you. Thank you.
  19. spirilis

    WizNet W5200 C library

    This is a code library implementing a sockets-oriented interface to the WizNet W5200. It's been a long time coming, and the plan is to implement DHCP support soon; almost there, had to rewrite the lib from scratch to allow piecemeal I/O with various socket types first. For now, the code includes working examples for the MSP430G2553 and MSP430F5529 LaunchPads. It needs a lot of documentation work though so don't fret if you can't get them working :-) More to come... Link: https://github.com/spirilis/w5200sock After DHCP support is working on the older W5200, I am going to adapt this into a W5500 library called w5500sock. As it stands right now though this library should be sufficient for building TCP and UDP clients and servers, managing several simultaneously along with doing repeated DNS lookups (A records only, i.e. dnslib_gethostbyname() is the only implemented client function so far). Much of the API is designed to allow the MCU to write or read data piecemeal without having to allocate any large buffers of its own to manage the data. See dnslib.c for good examples... there are flags for the various recv, send and flush calls which do "virtual" reads of the data without signalling the readiness to receive new packets, and the wiznet_send() and wiznet_sendto() calls take an argument as to whether the packet should be committed yet. This enables low SRAM usage for e.g. the G2553. I think the API is too fat for the G2452 though, so G2553 at a minimum.
  20. ofer

    MSP430G2553 and ENC28J60

    hi all, I'm trying to use an Ethernet module that i bought called "Ethernet LAN Module for Arduino / microcontrollers with SPI (ENC26J80)". I found a few example for it for different MSP430's but i cant get it to work. Does anyone know how to make it work? witch pins to connect and example code would be great. thanks, Ofer.
  21. Jaydeep

    MSP430F5438A ethernet

    hello, I am working on project in which i need internet connectivity. I am using MSP430F5438A. I came across many ethernet controllers, but i chose ENC28J60. does anybody know how to interface ENC28J60 with MSP4305438A ? any help would be appreciated.
  22. Ethernet - DMX Booster Pack. Uses WIZ820io on the Ethernet side and SN65HVD12 on the RS-485 side. XLR or RJ45 socket can be used. Compatible with MSP430, Stellaris, C2K, and Tiva LaunchPads. Will provide e1.31 example later on. If interested in a standalone version, I will have 2 and 4 universe versions very soon. 4 universe version will have Ethernet, XBee, and MIDI inputs.
  23. Hello, I am thinking on starting a new project, a web controlled robot!!! I was wondering if anyone has any experience with using an (Arduino)Ethernet shield with the MSP launchpad?? My plan is to build something like this: http://www.lynxmotion.net/viewtopic.php?f=20&t=6343 Or if anyone has any other ideas for easy, cheap web interaction with the launchpad. I don't want to use a wifi shield, because I would like to add video streaming in the future and wifi shields are not very video friendly. Thanks
×