---
title: "Lottery number! Good luck to you"
url: "https://maker.wiznet.io/irina/projects/lottery-number%21-good-luck-to-you/"
markdown_url: "https://maker.wiznet.io/irina/projects/lottery-number%21-good-luck-to-you/md"
type: "UCC: User Created Content"
author: "irina"
author_url: "https://maker.wiznet.io/irina/"
original_author: "irina"
original_url: "https://www.hackster.io/irinakim1225/lottery-number-good-luck-to-you-second-version-4f68b2"
license: "Apache License 2.0 (Apache-2.0)"
published: "2022-09-20"
language: "en"
hardware: ["WIZnet W5100S-EVB-Pico", "elenemt14 SSd1306(OLED)"]
likes: 25
views: 8098
comments: 2
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Lottery number! Good luck to you

> It performs TCP communication of APP of smartphone and W5100S-pico-evb.

Original author: irina (source: https://www.hackster.io/irinakim1225/lottery-number-good-luck-to-you-second-version-4f68b2)

## Components

- **WIZnet W5100S-EVB-Pico** x 1 ([docs](https://docs.wiznet.io/Product/Chip/Ethernet/W5100S/w5100s-evb-pico))
- **elenemt14 SSd1306(OLED)** x 1
- Software: **MicroPython** ([docs](http://micropython.org/))
- Software: **Animotech Inc. TCP/UDP TEST TOOL**

## Documents and links

- [Github](https://github.com/irinakim12/wiznet_lottery-number-generation) (code)

## Article

<https://www.hackster.io/irinakim1225/lottery-number-good-luck-to-you-first-version-14b02c>

This is the next project from the above link.

Use W5100s-pico-evb to get IP assigned through DHCP.

Here, IP of 192.168.100.14 was assigned and the port number was set to 5000.

Use W5100s-pico-evb as TCP Server.

![Thonny_tcp.JPG](https://hackster.imgix.net/uploads/attachments/1497621/thonny_tcp_HIQdPE9UES.JPG?auto=compress%2Cformat&w=740&h=555&fit=max)

Then, make a TCP connection using the smartphone's APP.

Here, the smartphone and W5100S-pico-evb must be connected to the same AP.

Click TCP CLIENT in the app.

![smart_app_1.JPG](https://hackster.imgix.net/uploads/attachments/1497619/smart_app_1_jK8usmF4TA.JPG?auto=compress%2Cformat&w=740&h=555&fit=max)

Enter the IP and port number to connect to.

![smart_app_2.JPG](https://hackster.imgix.net/uploads/attachments/1497620/smart_app_2_6QMBzukApr.JPG?auto=compress%2Cformat&w=740&h=555&fit=max)

When the connection is complete, data **"get"** is sent.

Then you can receive 6 random numbers from TCP Server (W5100s-pico-evb).

![smart_app_3.JPG](https://hackster.imgix.net/uploads/attachments/1497625/smart_app_3_svuWoEMsRu.JPG?auto=compress%2Cformat&w=740&h=555&fit=max)

![pico+smart.jpg](https://hackster.imgix.net/uploads/attachments/1497615/picosmart_fjmVTO4RYy.jpg?auto=compress%2Cformat&w=740&h=555&fit=max)

Next time I will try using the random number generator in the RP2040.

> "2.17.5. Random Number Generator" in <https://datasheets.raspberrypi.org/rp2040/rp2040-datasheet.pdf>

githuib : <https://github.com/irinakim12/wiznet_lottery-number-generation>

<https://youtu.be/K94VDUjdMlA>

---

Source: https://maker.wiznet.io/irina/projects/lottery-number%21-good-luck-to-you/
