Is there a PING component?

For general Flowcode discussion that does not belong in the other sections.
LeighM
Valued Contributor
Posts: 488
http://meble-kuchenne.info.pl
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 83 times
Been thanked: 261 times

Re: Is there a PING component?

Post by LeighM »

Just another idea...
If you have a raspberry pi on the network you could try running nmap.
This can be used to scan and report, see all the options available.
Could also run it in a script, run periodically from cron and push results to your mobile using ntfy.sh

RGV250
Posts: 340
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 34 times
Been thanked: 36 times

Re: Is there a PING component?

Post by RGV250 »

Hi,
I would rather see if I can make it work as I have more control over it. It is also good (hopefully) for the brain cells :D

I thought I had got somewhere but so far no good, I wonder if someone can have a look to see if I have done something wrong.
At the moment it should send out the ping request (if I have interpreted the original code correctly) and scroll through to 254 and then roll over to 1.
There appears to be 2 issues, I am not seeing anything in wireshark, I think I have the comms set up correctly?
Also I have never used the HDMI display before so not sure if that is correct. the colour of the embedded internet panel changes to blue but do not see any text on it. What should happen with the HDMI screen when the program is running on the Pi as all I see is the background when it has booted.
PING__03.fcfx
(23.37 KiB) Downloaded 38 times
Regards,
Bob

chipfryer27
Valued Contributor
Posts: 1684
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 374 times
Been thanked: 582 times

Re: Is there a PING component?

Post by chipfryer27 »

Hi Bob

Don't forget you can simulate including comms in FC and interact with the outside world, viewing variables in real-time. Details under the relevant properties.

Regards

RGV250
Posts: 340
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 34 times
Been thanked: 36 times

Re: Is there a PING component?

Post by RGV250 »

Hi,
At the moment I am only sending, if that works I think I can receive the incoming string and parse it for data unlike the original W5500 code where it receives individual bytes. Quite a few beers needed so would like to know if I have the send part OK before attempting the receive code.
When I simulate I can see the IP incrementing so in theory it has initialised and opened a socket but I am not seeing the text on the sim display and nothing in wireshark. Mind you I am no expert on that.

Regards,
Bob

LeighM
Valued Contributor
Posts: 488
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 83 times
Been thanked: 261 times

Re: Is there a PING component?

Post by LeighM »

Looks like you forgot to Connect before Send

RGV250
Posts: 340
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 34 times
Been thanked: 36 times

Re: Is there a PING component?

Post by RGV250 »

Hi,
Thanks, I totally missed that as it is not used in the W5500 code as far as I could see.
I am drinking the receive code though at the moment, that looks pretty straight forward unless it has to reply to a ping request which can be done later.
If I get time tomorrow (hangover permitting) I will add the connect and see how that goes.
I did wonder if I need to close the socket, it is constantly in use so I don't think it is needed.

Bob

RGV250
Posts: 340
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 34 times
Been thanked: 36 times

Re: Is there a PING component?

Post by RGV250 »

Hi,
I think I am getting closer, I don't have time to test at the moment but wondered if you could have a quick look at the start of Send_IP_data macro where I have added the connect.
I have used port 80 as I do not know if there is a specific one I should use.
The other question, it looks like the SocketOpen is for the local device so I do not need to close it after each send data. The next time the macro is called it will connect to the next address.
PING__04.fcfx
(28.81 KiB) Downloaded 27 times
Regards,
Bob

chipfryer27
Valued Contributor
Posts: 1684
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 374 times
Been thanked: 582 times

Re: Is there a PING component?

Post by chipfryer27 »

Hi Bob

I can't test either as I have no FC access and therefore not had a chance to look at any of your charts.

My understanding though is that your port number is actually irrelevant for "ping" as it takes place at a lower layer. ICMP if my memory serves, which is not a protocol for sending and receiving data, so no port numbers are used. Basically it sends an ICMP "echo".

However in saying that I think (and might be very wrong) that some windows network managers / diagnotics seem to like 139, although I suspect that is something very specific to that software. Really can't remember that much.

Regards

RGV250
Posts: 340
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 34 times
Been thanked: 36 times

Re: Is there a PING component?

Post by RGV250 »

Thanks,
The connect function requires a port number so I had to put something in, maybe it will not matter.

Bob

LeighM
Valued Contributor
Posts: 488
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 83 times
Been thanked: 261 times

Re: Is there a PING component?

Post by LeighM »

Yes, the connect is only relevant to the TCP, which I think is the only protocol that the Raspberry Pi component supports.
The Matrix tutorial uses the W5500 and component that is capable of lower layer protocols

Post Reply