Use IRC for project - question reddit / irc ---------------------------------------------------------------------- noiceGenerator · 2020-12-02 12:36 Hi folks! I have a project at my university where I should send automatized unencrypted messages between 2 pc-s (Raspberries). Now the issue is that these can be in arbitrary networks. I got IRC recommended but I have never used it before, so I have a few questions: \- Is IRC even suitable for such thing? I would have to send the output of 1 pc via IRC to another and read the messages (ouput of the other pc) and then do some computations. \- If it is should I set up my own server or are there public ones (for educational purposes) which would tolerate me sending automated gibberish? \- If I should set up my own server how do I do that? I tried to follow this guide ([https://ubuntu.com/tutorials/irc- server#8-congratulations](https://ubuntu.com/tutorials/irc- server#8-congratulations)) but I cannot connect to my own server (connection times out). ---------------------------------------------------------------------- mindlesstux · 2020-12-02 14:30 Based on your first bullet point I would have gone for a MQTT broker. IRC is ment to be more of a chat protocol than what your first point describes to me a message broker. While IRC can be used for the point of sending output of commands and the like, I would say not its purpose. If you insist on continuing down the path of IRC... Point two... Without knowning how much or how fast you would be sending data, a lot of publicly run IRC networks and the servers that run them have a rate limit setup. So if you were to host your own IRC network for this... You would need to find what the sending limit is and see if you are going to send within those confines or need to remove them. Point three... If on the same network, then first thought is firewall on the ubuntu box? If not on the same network then port forwards and the like are nessary. ---------------------------------------------------------------------- NeuroG · 2020-12-02 14:30 IRC has been used as remote command and control between computers for nefarious actors for decades. It works for that, but most networks will consider that against their TOS. You can probably find a network that is fine with it for legitimate purposes, if you read around. If it's just an occasional message between two computers you own, I doubt anyone would care anyway. Just put them in a private query, and not on a channel with humans, obviously. There are several encryption schemes people have concocted over IRC, but none are built in. Take a look in [here](https://weechat.org/scripts/) for some examples. If you are thinking about setting up your own IRC server for this, I would think that just using SSH would be much more straightforward. ---------------------------------------------------------------------- noiceGenerator · 2020-12-02 14:36 The idea behind using IRC is that the 2 pc-s do not know the other's ip, only their own. How could I achieve communication via ssh on these terms? ---------------------------------------------------------------------- noiceGenerator · 2020-12-02 14:39 I do not insist at all. TBH I just wish to use an application, to which I send the ip's of the 2 computers, then said application establishes communication and then they communicate. ---------------------------------------------------------------------- NeuroG · 2020-12-02 14:56 Tor hidden services were built to do exactly that. That would be far more secure and reliable than something hacked with IRC. ---------------------------------------------------------------------- noiceGenerator · 2020-12-02 15:31 Honestly, it does not need to be secure in any way. The messages I send make only sense if one has the exact same Raspberry Pi setup as I do and even if they have, it's just putting actuators to work. ---------------------------------------------------------------------- IBNash · 2020-12-02 18:56 Need more details.. are the RPi's just data emitters.. sending simple sensor data for instance?Or would you like to be able to control the RPi's from each other? When you say they don't know each other's IP, do they communicate using hostnames? The devil is in the details.. ---------------------------------------------------------------------- LameBMX · 2020-12-02 21:21 Lots and lots of questions here. Since this seems to be a typical XY problem. Let's start with, what is the actual problem you are trying to solve? ---------------------------------------------------------------------- frumious · 2020-12-02 23:38 > these can be in arbitrary networks Are they visible to each other? Ie, no NAT or firewall issues? I'd likely use ZeroMQ. IRC is not a good choice for direct peer-to-peer connections. ---------------------------------------------------------------------- __TBD · 2020-12-03 00:37 Based what you typed and what i understand from there. Look like you don't need irc to accomplish the task. Why not just telnet and send msg between 2pc? ---------------------------------------------------------------------- noiceGenerator · 2020-12-03 15:20 I have 2 Raspberries, each of them connected to the Internet (in different networks) AND to sensors and actuators. After automatically establishing the connection, they send messages hence and forth. Eg. pi X reads a sensor input, sends it to pi Y which after receiving the message outputs it by using its (Y's) actuator. Then vice-versa until someone gets bored and disconnects. Also /u/IBNash /u/frumious /u/__TBD ---------------------------------------------------------------------- LameBMX · 2020-12-03 15:47 Does your project have restrictions? Like could you setup a freedns.afraid.org and install an application on the pi's to keep the host name updated on afraid. Then you can just ssh (or telnet) using the hostnames. ---------------------------------------------------------------------- noiceGenerator · 2020-12-03 15:56 Not really restricted, I could even use a third pc/server. What does this [freedns.afraid.org](https://freedns.afraid.org) do? What is the idea behind it? ---------------------------------------------------------------------- LameBMX · 2020-12-03 16:04 Its a free dns service. ---------------------------------------------------------------------- noiceGenerator · 2020-12-08 15:11 Could you please give me a slight nudge how to start? ---------------------------------------------------------------------- LameBMX · 2020-12-08 18:43 Goto freedns.org create a free subdomain. Put in the ip addresses for the pi's. Or make one up if you don't know it. Find app for the pi that will keep you subdomain up to date. Put info into app. When that runs, instead of ip, you use the subdomain to contact the pi. If the pi's ip address changes, the app should update the subdomain, so you can still access the pi via the subdomain . ---------------------------------------------------------------------- noiceGenerator · 2020-12-15 10:03 >keep you subdomain up to date Do I get it right that it takes one hour till the IP of subdomain gets updated? ---------------------------------------------------------------------- LameBMX · 2020-12-15 18:35 Depends on how fast the app on the pi will update. For the most part, IP's don't change that often these days. As I recall something like afraid is updated when it gets updated. On the client side, depends how often the client checks for updated dns records. Pretty much everything these days has a way to clear out the cached dns entries (windows its ipconfig /flushdns) ---------------------------------------------------------------------- noiceGenerator · 2020-12-29 15:32 How do I set the port at freedns? I mean I got the subdomain update under control but I still cannot reach my Raspberry via ssh without a port. ---------------------------------------------------------------------- LameBMX · 2020-12-29 18:55 Freedns doesn't deal with port. It directs all traffic. I don't know what ssh client you are using but most all should accept username@user.afraid.net:22 or for login prompt user.afraid.net:22 (change port if needed) simply replace ip only with the dns ---------------------------------------------------------------------- noiceGenerator · 2020-12-30 08:03 I'm ashamed how dumb I feel right now but I still don't get it. Let's say I have a subdomain [`example.mooo.com`](https://example.mooo.com) at the IP `xxx.yyy.zzz.www`, with the username `user` at freedns.afraid.org. That IP is the current public IP of my Raspberry with the user `pi`. Now what do I need to do/set up, if I wish to ssh my Raspberry? Something like `ssh` [`pi@example.mooo.com`](mailto:pi@example.mooo.com) `-p .` ---------------------------------------------------------------------- LameBMX · 2020-12-31 14:50 Exactly. You can test manual ssh to the pi using putty. ---------------------------------------------------------------------- noiceGenerator · 2021-01-01 08:06 But how? I have no idea what the port is. The Raspberry either. ---------------------------------------------------------------------- LameBMX · 2021-01-01 18:03 It would be the same port you used to connect via IP. Default is port 22. Cat /etc/sshd.conf or ssh.conf and port will be listed in that document.