[Hampshire] Raspberry Pi, RS485 and libmodbus
I am trying to connect an energy monitor to a raspberry pi equipped with a small RS485 card from AB electronics. Effectively the card is just an interface chip between the pi's GPIO pins and the RS485 bus which is just 3 wires. I have installed libmodbus and followed the instructions to disable the serial port login. Originally I was working with the Bluetooth equipped RP3 but reverted to RP2 running wheezy because bluetooth complicates things and I thought I would avoid it. If anybody is familiar with this sort of setup and may have possibly come up against the following problem I would be grateful. I have done the "make check" which tests the libmodbus installation. I have modified the "test" programme for my environment and the initialisation and connection are OK but when I try to read the registers, I get a timeout. The fault could be anywhere. Thanks, Roger nd connect correc -- Please post to: Hampshire@mailman.lug.org.uk Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire LUG URL: http://www.hantslug.org.uk --
Re: [Hampshire] ufw
Hi rob You could always test it from the machine you are allowing... Use telnet and try to connect to another port that you know is running a service on the destination machine.. Thanks G On 3 Nov 2017 3:41 p.m., "Rob Malpass via Hampshire" < hampshire@mailman.lug.org.uk> wrote: > Thanks both – so if I do > > > > sudo ufw allow from 192.168.0.99 to any port 22 > > > > then am I doing anything other than saying 192.168.0.99 can ssh in to this > machine? This is what I’m trying to achieve but the “any” is confusing me > somewhat – though the rule itself does seem to be doing what I want. > > > > Cheers > > Rob > > > > *From:* Hampshire [mailto:hampshire-boun...@mailman.lug.org.uk] *On > Behalf Of *Gareth Evans via Hampshire > *Sent:* 03 November 2017 15:28 > *To:* Peter B.; Hampshire LUG Discussion List > *Subject:* Re: [Hampshire] ufw > > > > man ufw doesn't seem to have much to say on the matter, but > > > > https://help.ubuntu.com/community/UFW > > > > suggests "any" in this context means any destination IP address (given > that there may be many associated with a host): > > > > *Allow by specific port, IP address and protocol* > > > > sudo ufw allow from to port proto > > > > > *example: allow IP address 192.168.0.4 access to port 22 using TCP* > > > > sudo ufw allow from 192.168.0.4 to any port 22 proto tcp > > > > > > > > On Fri, 3 Nov 2017, at 14:57, Peter B. via Hampshire wrote: > > From any port on y Maybe? > > > > On 3 Nov 2017 14:53, "Rob Malpass via Hampshire" < > hampshire@mailman.lug.org.uk> wrote: > > Hi all > > > > Simple question (I hope). If I’m opening port x from ip address y on my > network with the following command > > > > sudo ufw allow from y to any port x > > > > …then where does the “any” come from? Anyone know? Seems strange to > say “any port” then list the port number – unless I’ve misunderstood the > rule. > > > > Cheers > > Rob > > > > -- > > Please post to: Hampshire@mailman.lug.org.uk > > Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire > > LUG URL: http://www.hantslug.org.uk > > -- > > -- > > Please post to: Hampshire@mailman.lug.org.uk > > Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire > > LUG URL: http://www.hantslug.org.uk > > -- > > > > -- > Please post to: Hampshire@mailman.lug.org.uk > Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire > LUG URL: http://www.hantslug.org.uk > -- > -- Please post to: Hampshire@mailman.lug.org.uk Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire LUG URL: http://www.hantslug.org.uk --
Re: [Hampshire] ufw
My understanding would agree with yours, but "machine" is the key point. If you had mulltiple IP addresses on your server, "any" would allow 192.168.0.99 to ssh into any of them. If you only have one, it doesn't matter, but might be worth bearing in mind in case you set up another which you don't want 192.168.0.99 to be able to ssh into. In this case you would need to replace "any" with the IP address you do want to be ssh'd into. On Fri, 3 Nov 2017, at 15:41, Rob Malpass via Hampshire wrote: > Thanks both – so if I do > > sudo ufw allow from 192.168.0.99 to any port 22 > > then am I doing anything other than saying 192.168.0.99 can ssh in to > this machine? This is what I’m trying to achieve but the “any” is > confusing me somewhat – though the rule itself does seem to be doing > what I want.> > Cheers > Rob > > *From:* Hampshire [mailto:hampshire-boun...@mailman.lug.org.uk] *On > Behalf Of *Gareth Evans via Hampshire *Sent:* 03 November 2017 15:28 > *To:* Peter B.; Hampshire LUG Discussion List *Subject:* Re: > [Hampshire] ufw> > man ufw doesn't seem to have much to say on the matter, but > > https://help.ubuntu.com/community/UFW > > suggests "any" in this context means any destination IP address (given > that there may be many associated with a host):> >> *Allow by specific port, IP address and protocol* >> >> sudo ufw allow from to port >> proto >> >> *example: allow IP address 192.168.0.4 access to port 22 using TCP*>> >> sudo ufw allow from 192.168.0.4 to any port 22 proto tcp > > > > On Fri, 3 Nov 2017, at 14:57, Peter B. via Hampshire wrote: >> From any port on y Maybe? >> >> On 3 Nov 2017 14:53, "Rob Malpass via Hampshire" >>wrote:>>> Hi all >>> >>> Simple question (I hope). If I’m opening port x from ip address y >>> on my network with the following command>>> >>> sudo ufw allow from y to any port x >>> >>> …then where does the “any” come from? Anyone know? Seems strange >>> to say “any port” then list the port number – unless I’ve >>> misunderstood the rule.>>> >>> Cheers >>> Rob >>> >>> -- >>> Please post to: Hampshire@mailman.lug.org.uk >>> Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire>>> LUG >>> URL: http://www.hantslug.org.uk >>> -- >> -- >> Please post to: Hampshire@mailman.lug.org.uk >> Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire>> LUG >> URL: http://www.hantslug.org.uk >> -- > > -- > Please post to: Hampshire@mailman.lug.org.uk > Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire > LUG URL: http://www.hantslug.org.uk > -- -- Please post to: Hampshire@mailman.lug.org.uk Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire LUG URL: http://www.hantslug.org.uk --
Re: [Hampshire] ufw
Thanks both – so if I do sudo ufw allow from 192.168.0.99 to any port 22 then am I doing anything other than saying 192.168.0.99 can ssh in to this machine? This is what I’m trying to achieve but the “any” is confusing me somewhat – though the rule itself does seem to be doing what I want. Cheers Rob From: Hampshire [mailto:hampshire-boun...@mailman.lug.org.uk] On Behalf Of Gareth Evans via Hampshire Sent: 03 November 2017 15:28 To: Peter B.; Hampshire LUG Discussion List Subject: Re: [Hampshire] ufw man ufw doesn't seem to have much to say on the matter, but https://help.ubuntu.com/community/UFW suggests "any" in this context means any destination IP address (given that there may be many associated with a host): Allow by specific port, IP address and protocol sudo ufw allow from to port proto example: allow IP address 192.168.0.4 access to port 22 using TCP sudo ufw allow from 192.168.0.4 to any port 22 proto tcp On Fri, 3 Nov 2017, at 14:57, Peter B. via Hampshire wrote: >From any port on y Maybe? On 3 Nov 2017 14:53, "Rob Malpass via Hampshire"wrote: Hi all Simple question (I hope). If I’m opening port x from ip address y on my network with the following command sudo ufw allow from y to any port x …then where does the “any” come from? Anyone know? Seems strange to say “any port” then list the port number – unless I’ve misunderstood the rule. Cheers Rob -- Please post to: Hampshire@mailman.lug.org.uk Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire LUG URL: http://www.hantslug.org.uk -- -- Please post to: Hampshire@mailman.lug.org.uk Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire LUG URL: http://www.hantslug.org.uk -- -- Please post to: Hampshire@mailman.lug.org.uk Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire LUG URL: http://www.hantslug.org.uk --
Re: [Hampshire] ufw
man ufw doesn't seem to have much to say on the matter, but https://help.ubuntu.com/community/UFW suggests "any" in this context means any destination IP address (given that there may be many associated with a host): > *Allow by specific port, IP address and protocol* > > sudo ufw allow from to port proto > > > *example: allow IP address 192.168.0.4 access to port 22 using TCP** *> > sudo ufw allow from 192.168.0.4 to any port 22 proto tcp On Fri, 3 Nov 2017, at 14:57, Peter B. via Hampshire wrote: > From any port on y Maybe? > > On 3 Nov 2017 14:53, "Rob Malpass via Hampshire" >wrote:>> Hi all__ >> __ __ >> Simple question (I hope). If I’m opening port x from ip address y >> on my network with the following command__>> __ __ >> sudo ufw allow from y to any port x__ >> __ __ >> …then where does the “any” come from? Anyone know? Seems strange >> to say “any port” then list the port number – unless I’ve >> misunderstood the rule.__>> __ __ >> Cheers__ >> Rob__ >> >> -- >> Please post to: Hampshire@mailman.lug.org.uk >> Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire>> LUG >> URL: http://www.hantslug.org.uk >> -- > -- > Please post to: Hampshire@mailman.lug.org.uk > Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire > LUG URL: http://www.hantslug.org.uk > -- -- Please post to: Hampshire@mailman.lug.org.uk Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire LUG URL: http://www.hantslug.org.uk --
Re: [Hampshire] ufw
I am not an expert but acordinng to the man page the long format appears to be ufw toSo this will allow a connection from Y to any destination on port X. On 3 November 2017 14:57:02 GMT+00:00, "Peter B. via Hampshire" wrote: >From any port on y Maybe? > >On 3 Nov 2017 14:53, "Rob Malpass via Hampshire" < >hampshire@mailman.lug.org.uk> wrote: > >> Hi all >> >> >> >> Simple question (I hope). If I’m opening port x from ip address y >on my >> network with the following command >> >> >> >> sudo ufw allow from y to any port x >> >> >> >> …then where does the “any” come from? Anyone know? Seems strange >to >> say “any port” then list the port number – unless I’ve misunderstood >the >> rule. >> >> >> >> Cheers >> >> Rob >> >> -- >> Please post to: Hampshire@mailman.lug.org.uk >> Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire >> LUG URL: http://www.hantslug.org.uk >> -- >> -- Sent from my Android device with K-9 Mail. Please excuse my brevity.-- Please post to: Hampshire@mailman.lug.org.uk Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire LUG URL: http://www.hantslug.org.uk --
Re: [Hampshire] ufw
>From any port on y Maybe? On 3 Nov 2017 14:53, "Rob Malpass via Hampshire" < hampshire@mailman.lug.org.uk> wrote: > Hi all > > > > Simple question (I hope). If I’m opening port x from ip address y on my > network with the following command > > > > sudo ufw allow from y to any port x > > > > …then where does the “any” come from? Anyone know? Seems strange to > say “any port” then list the port number – unless I’ve misunderstood the > rule. > > > > Cheers > > Rob > > -- > Please post to: Hampshire@mailman.lug.org.uk > Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire > LUG URL: http://www.hantslug.org.uk > -- > -- Please post to: Hampshire@mailman.lug.org.uk Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire LUG URL: http://www.hantslug.org.uk --
[Hampshire] ufw
Hi all Simple question (I hope). If I'm opening port x from ip address y on my network with the following command sudo ufw allow from y to any port x .then where does the "any" come from? Anyone know? Seems strange to say "any port" then list the port number - unless I've misunderstood the rule. Cheers Rob -- Please post to: Hampshire@mailman.lug.org.uk Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire LUG URL: http://www.hantslug.org.uk --