mirror of
				https://github.com/0xFEEDC0DE64/arduino-esp32.git
				synced 2025-10-26 03:31:43 +01:00 
			
		
		
		
	* Added a basic WiFi UDP client example: a sketch that sends random bytes over udp. * Updated udp example and included Python and Ruby UDP servers.
		
			
				
	
	
		
			16 lines
		
	
	
		
			315 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			315 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| # This ruby script listens on UDP port 3333 
 | |
| # for messages from the ESP32 board and prints them
 | |
| 
 | |
| require 'socket'
 | |
| include Socket::Constants
 | |
| 
 | |
| udp_socket = UDPSocket.new(AF_INET)
 | |
| 
 | |
| #bind 
 | |
| udp_socket.bind("", 3333)
 | |
| puts 'Server listening'
 | |
| 
 | |
| while true do
 | |
|   message, sender = udp_socket.recvfrom(1024)
 | |
|   puts message
 | |
| end |