Home>

I'm a beginner who recently started to touch python and raspberry pi.
I'm very sorry for the amateur question because I don't understand the concept, but I would like to build the following system.

・ PC used
Child, raspberry pi ① (instead of QRcode reader)
Parent, raspberry pi② (or desktop PC)

Recognize products with QR code in 1 and ①
Register the data recognized in 2, ① with the python code in the SQL database of ② on the local network via Wi-Fi.
3, Communicate from ① to ② to display the registered database

I cannot imagine the environment required at this time.
I used to play with PHP and MySQL using XAMPP, and at that time I was connected to MySQL (phpMyAdmin) on the same PC.
However, is it possible to connect to XAMPP running on the parent PC from another PC via Wi-Fi like this time and play with MySQL on the parent PC from the GUI of python started on the child PC?

It may be difficult to express your intentions in words due to lack of knowledge, but please teach.

  • Answer # 1

    It is possible, but it is easy to get caught in the following points.

    There may be security settings that prevent Wifi devices from communicating with each other due to the Wifi router function. In that case, disable it. For Buffalo: What is the privacy separator function?

    Open the port (3306 by default) used by MySQL for the firewall of the Raspberry Pi or desktop PC in (2) where MySQL is running.

    Since the MySQL user needs to specify the connection source IP, specify the connection permission IP correctly when creating the MySQL user for ① (or create a user that can be accessed from anywhere)

    Especially if it gets stuck at 1, it will not connect no matter how much the setting is changed on the OS side, so
    First of all, it is easy to separate by connecting by wire and confirming that there is no problem, and then connecting by Wifi.

  • Answer # 2

    Is possible. Until now for DB settingslocahostDo you remember that you put it in? If you set that to the host name or IP address of raspberry pi ②, you can communicate without problems. Moreover, if it is in the local network and the rasberry pi is supported by the router.localYou can also access it with a domain name such as. So what you do

    ② Decide the machine name

    (2) Install and start the MySQL server in

    In the DB host name of the application of ①<②>.localTo set

    Only this. Rather, it's just that things that are originally separated in this way are started together on localhost because it is troublesome at the time of development.

  • Answer # 3

    Is possible.
    No problem.