# Can't connect pi4 with my pc and my pc as broker

**URL:** https://discourse.nodered.org/t/cant-connect-pi4-with-my-pc-and-my-pc-as-broker/75480
**Category:** Share Your Projects
**Created:** [20 February 2023 16:45 UTC](https://discourse.nodered.org/t/cant-connect-pi4-with-my-pc-and-my-pc-as-broker/75480 "2023-02-20T16:45:10Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ZEus](https://avatars.discourse-cdn.com/v4/letter/z/a4c791/32.png) [@ZEus](https://discourse.nodered.org/u/ZEus)
#### Post date: [20 February 2023 16:45 UTC](https://discourse.nodered.org/t/cant-connect-pi4-with-my-pc-and-my-pc-as-broker/75480/1 "2023-02-20T16:45:10Z")

</div>

Hello everyone im new to node-red . Im trying to connect a plc s7-1200 with pi4 using mqtt ( mosquitto) and setting up my pc as a broker so the problem is my pi4 can't connect with my pc when activating node red in terminal (1883 port) and when i tried to ping the pi4 it's unsuccessful. i followed a youtube tutorial here is the link : [communication between Raspberry PI and PLC S7 1200 using MQTT - YouTube](https://www.youtube.com/watch?v=lAE87QHv3HY&t=583s)  
ps:in the video he opened node red in his pc and i couldn't do that only in pi4  
please if you have any ideas let me know ill be appreciated

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [20 February 2023 17:07 UTC](https://discourse.nodered.org/t/cant-connect-pi4-with-my-pc-and-my-pc-as-broker/75480/2 "2023-02-20T17:07:13Z")

</div>

It seems odd to install Mosquitto on a PC if you have a Raspberry Pi4 with Node-red on it.

It's simple and very reliable to install Mosquitto on a Pi and you can guarantee that MQTT messages will continue to flow even if the PC is turned off.  
The MQTT broker should have a static IP and Mosquitto has to be configured to allow connections from other devices.

> [@ZEus](#):
>
> the problem is my pi4 can't connect with my pc when activating node red in terminal (1883 port) and when i tried to ping the pi4 it's unsuccessful.

If you can't ping the Pi, can you see it on the network? IpScan24 on the PC is a good tool for this.  
What does the **ifconfig** command on the Pi show?
