Data reception over Ethernet using UDP and storing into SD card using CYW954907AEVAL1F

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
HaTr_4568521
Level 2
Level 2
First like given

Hi There, I've been working on a project that receives data using an UDP protocol and stores the same into the SD card. While going through the sd_filesystem.c and sd_filesystem.mk already available in the WICED studio, i could see that platform supported are: BCM943907AEVAL1F* CYW943907AEVAL1F CYW943907WAE4 BCM943907WCD2. The one that I'm using is Search Results Web results  CYW954907AEVAL1F Evaluation Kit. Kindly help fixing the issue.

I'm basically using two files: udp_receive.c and sd_filesystem.c to create this project.

Also, is this the only way to fetch data over Ethernet and store in SD card? or there are any other methods available too?

0 Likes
1 Solution
Murali_R
Moderator
Moderator
Moderator
250 sign-ins 250 replies posted 100 solutions authored

Hi

Add the CYW954907AEVAL1F to the list of VALID_PLATFORMS and the build should go through. This works because both the 54907 and the 43907 use the same WLAN chip.

Also, is this the only way to fetch data over Ethernet and store in SD card? or there are any other methods available too?

--> By "is this the only way", do you mean if UDP is the only way to do it? Could you please elaborate on this?

Thanks

View solution in original post

0 Likes
11 Replies
Murali_R
Moderator
Moderator
Moderator
250 sign-ins 250 replies posted 100 solutions authored

Hi

Add the CYW954907AEVAL1F to the list of VALID_PLATFORMS and the build should go through. This works because both the 54907 and the 43907 use the same WLAN chip.

Also, is this the only way to fetch data over Ethernet and store in SD card? or there are any other methods available too?

--> By "is this the only way", do you mean if UDP is the only way to do it? Could you please elaborate on this?

Thanks

0 Likes

Thanks MuraliR_36​ for the Prompt responce. I'll add that to the code and see

My actual application is to fetch data from an Ethernet Port connected to CWY954709AEVAL1, Transmit and Receive it Wirelessly, and Store the received data into SD card.

As a firtst step towards this development, what I could make out (based on available literature) was to use udp_receive to fetch data over ethernet port (I can use TCP/IP as well, but UDP is more suitable for my application) and use sd_filesystem.c to store the received data in the same board. Is this the correct way to meet the target application or I might be missing something? Since, after burning udp_receive program to the board, when I connected the Ethernet port, I could not observe any blink which is usually available the moment you connect the Ethernet cable to the module.

0 Likes

Hi

I don't see any issues with your implementation when viewed briefly and should work fine. Do let me know if you face any issues.

Since, after burning udp_receive program to the board, when I connected the Ethernet port, I could not observe any blink

--> I used the same application and don't see any issues. Are you using the default application that comes with WICED? If so,did you set the WICED_NETWORK_INTERFACE to WICED_ETHERNET_INTERFACE in the wifi_config_dct.h file?

Thanks

Hello MuraliR_36​, Yes, I tried the same Way. Images are attached herewith.error1.pngerror2.png

As shown in the images, Firstly, I copied the existing wifi_config_dct.h in the project folder where UDP_Receive_Harsh.c and UDP_Receive_Harsh.mk files were kept. then in the same file (wifi_config_dct.h in the new location), I modified the WICED_NETWORK_INTERFACE to WICED_ETHERNET_INTERFACE.

The code could successfully be burnt to the controller, however, I could not observe any blink in the Ethernet port.

P.S.: No changes were done in UDP_Receive_Harsh.c and UDP_Receive_Harsh.mk files

0 Likes

Could you try doing a platform_ethernet_init(); after wiced_network_up() just to be sure, the ethernet interface is initialised.

I tried it again and the ethernet port blinks.

Are the connection (orange) and the activity(green) LED's of the ethernet port turned on after you burn the code and connect an ethernet cable?

Thanks

0 Likes

Hello MuraliR_36​, I don't have idea how would I do that. Shall I just write

platform_ethernet_init();

after

    result = wiced_network_up_default( &interface, &device_init_ip_settings );

    if( result != WICED_SUCCESS )

    {

        printf("Bringing up network interface failed !\r\n");

    }

    /* Create UDP socket */

    if (wiced_udp_create_socket(&udp_socket, PORTNUM, interface) != WICED_SUCCESS)

    {

        WPRINT_APP_INFO( ("UDP socket creation failed\n") );

    }

    /* Register a function to process received UDP packets */

    wiced_rtos_register_timed_event( &process_udp_rx_event, WICED_NETWORKING_WORKER_THREAD, &process_received_udp_packet, 1*SECONDS, 0 );

    WPRINT_APP_INFO(("Waiting for UDP packets ...\n"));

}

--------------------------------------------------------------------------------------------------------------------

Can you please let me know how do I implement your suggestion? cause i tried the way I mentioned above, and is still not working.

0 Likes

Hello HaTr_4568521

I made a few changes to your application and have attached the same along with the Log.

  1. I changed the wiced_network_up_default api to wiced_network_up since I’m using static IP assignment to the ethernet port as I don’t have a DHCP server running on my PC.
  2. Removed the wifi_confi_dct.h file since it isn’t required for this implementation.

Steps to reproduce

  1. Assign a static IP to your ethernet port on your PC.
  2. Burn the Code on to your board.
  3. Once you arrive at the ‘Waiting for UDP packets ...’ run the udp_transmit.py that I have attached in the archive file and you should receive the message “Hello!”

If this too doesn’t work, check the ethernet cable being used i.e, try both a straight through cable as well as a cross over cable.

Thanks

Hello MuraliR_36​, many thanks for the help. The code seems to be working and I'm able to observe the orange LED blink initially and thereafter the orange LED becomes stable. I assigned a static IP to my system within the same subnet mask.

The query that I'm left with is, I'm not able to see "Waiting for UDP packets ..." message. Do I need to use a terminal emulator like TeraTerm for that or it'll be visible in WICED itself??

0 Likes

Hi HaTr_4568521

Yes you need to use a terminal emulator like teraterm and then you need to run the python script (udp_transmit.py) that i have attached in the .rar file attached in my previous response and you should get the response "Hello!".

Thanks

HaTr_4568521
Level 2
Level 2
First like given

Hello MuraliR_36​, I was trying to modify the suggested solution to transfer the data from a specific location from my computer to the SD card on the CYW954907AEVAL1F. But cold not make much as in where to modify the existing code. I could find that sd_filesystem.c would be usefult once I receive data from My computer to the CYW954907AEVAL1F board. However, what I'm not sure about is how to modify the existing code (the one which you helped to receive the blink and Hello message.) to accomplish the goal. Kindly help.

0 Likes