Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Tinkering; Like Guntering for the Connected Generation.

Options
1910111315

Comments

  • Registered Users Posts: 5,979 ✭✭✭emaherx


    I checked the configuration of my own CPE's

    My farm network is 192.168.2.x

    My CPE's are on subnet 192.168.188.x,

    The Subnet mask is 255.255.255.0 (so these are separate subnets)

    The CPE on the same wired network as the router is the main AP, the other 3 are clients with PTP option enabled. They also separately have an AP option enabled (This is just to allow them act as AP for other 5Ghz devices). All client devices for the 4 CPE's, camera's etc are in the 192.168.2.x. There is no routing enabled so none of the devices can ping 192.168.188.x unless of course their subnets are changed (or a secondary IP is configurable).

    To add to the complexity my house is off farm and its subnet is 192.168.1.x, I have a WireGuard VPN setup between the 2 sites, from my house I can connect to every 192.168.2.x device on the farm without issue, I cannot however connect to the CPE's IP's as their subnets are not routed through the VPN.

    Post edited by emaherx on


  • Registered Users Posts: 369 ✭✭Gman1987


    Had a deeper look at the network today. plugged in at client and no internet coming through. Plugged in laptop up at AP then and I have internet there but changed the IP to 192.168.10.254 in order to line up with network (reset the nanostation instead of just amending the IP). Plugged directly in to client then but could not gain entry (this was the unit that got unplugged for circa, 11 months) I forced a reset on the unit then and after this I managed to gain entry and set it up in client mode with an IP set to 192.168.10.253 and locked it into the AP. When completed I tested to see had I any internet and unfortunately I didnt. Looks like their is an issue with a nanostation. I need to get it set up asap as cows have started to calve so I picked up two nanostations this evening and new cable while I was at it so I'll get this installed on Saturday. I have a temporary system set up via home plugs until I get the new connection setup, getting a picture with this but its cutting in and out, no chance of working the PTZ



  • Registered Users Posts: 5,979 ✭✭✭emaherx


    Is PTP enabled on both devices after resetting them? (Could be called WDS on some models)




    If you are setting up new ones, configure and test them in the comfort of your kitchen before hanging out of poles or sheds on Saturday.

    Post edited by emaherx on


  • Registered Users Posts: 369 ✭✭Gman1987


    Took into it this evening after. checked and WDS was showing in auto. Swapped out wires first and tested but no luck so I swapped out the two nanostations and put new ones back up (Ubiquiti locoM5). System up and running now.


    Tested the old nanostations tonight but no LAN through. Reset both, set up AP again and when I went to search for AP when setting up client it wasnt appearing. I wasnt sure which one was causing the issue then so I went back to AP and changed to repeater. I could pick it up on the phone wifi then when I tried. I did the same with the client side and when I swapped them back to AP and client I was able to make the connection. Not 100% sure what the actual issue was but its working now after swapping over to repeater and then back to AP/client



  • Registered Users Posts: 5,979 ✭✭✭emaherx


    Glad you got sorted, at least now you can watch for cows caving in comfort.



  • Advertisement
  • Registered Users Posts: 369 ✭✭Gman1987




  • Registered Users Posts: 5,979 ✭✭✭emaherx




  • Registered Users Posts: 5,979 ✭✭✭emaherx


    I'm integrating farmOS with Home Assistant, so I'll have all camera feeds, sensors and farm management database accessible from a single portal.

    The Home Assistant Node Red Addon is proving useful for automating farmOS tasks and importing / exporting data to other applications such as Google Calendar.

    The flow above will read Google Calendar events with the term 'Cow Serviced {{Cow Number}}' and create 2 log entries in farmOS database one for Serviced Date and one for Due Date as well as create a Due Date entry in Google Calendar.

    The flow can also enable some flags so the details can be verified later.


    I'm also considering adding Live data beneath camera feeds, with information such as cows in pen and due dates.

    I realize some of the cameras above are a bit wonky, but I'm setting up some new pens this week.



  • Registered Users Posts: 323 ✭✭rounders


    How technical is the setup of Farm OS?

    I'm working off farm in IT consulting so I'm technical enough but I haven't touched a line of code since my college days


    EDIT- Just looked at some Youtube videos. Might try and set it up in the next few weeks

    Post edited by rounders on


  • Registered Users Posts: 5,979 ✭✭✭emaherx


    Technical enough, but if you are an IT consultant I'm sure you could figure it out. From a setup point of view it is a webserver so knowledge of maintaining a webserver with database would help. Mine is running on Docker on a Raspberry Pi, here is my initial setup https://farmer-eds-shed.com/farmos-version-2-raspberry-pi-install/. (other installs are probably more straight forward.)

    There isn't necessarily a need to know any code for basic record keeping, but it can be lacking in some features specific to a livestock farm in some ways compared to some of the more well known livestock focused packages available, however it does have an API with options to interface in a number of ways including Python, Java script and Json:API. It is also free and open sourced with good support from the main Developers on https://farmos.discourse.group/. Most features it is lacking in can be more than made up for with a little coding knowledge, I'm experimenting with Node Red the last few days which is a good low code solution. It doesn't currently sync up with the DAFM AgFood portal, so I'm going to put something to work with the CSV files for importing Data.

    They also have a paid hosted version https://farmier.com/



  • Advertisement
  • Registered Users Posts: 323 ✭✭rounders


    Yeah it's actually for a enterprise cloud software that I'm consulting for so should be able for it

    Would be great to have sub form for custom code for Irish setup like what you mentioned about the CSV file from AgFood.

    Some of the marts issue files with their statement for uploading into Fullwoods software so maybe that could be leveraged.

    Would have to look at the file type they send again


    Edit - would be curious how the updates will sync with custom code. One major problem we see with enterprise system is companies over customizing and then not bring able to update



  • Registered Users Posts: 5,979 ✭✭✭emaherx


    Do you mean if you create a custom module and then a farmOS update potentially breaks it?

    My understanding is that it shouldn't be an issue for a long time, farmOS 2 is a distribution of Drupal 9 and modules and API's are all built to Drupal 9 standards. They have just migrated from farmOS 1 which was based on Drupal 7, there were breaking changes in regard to custom modules and even the API after that migration but its not expected with the regular upgrades of farmOS 2.x.



  • Registered Users Posts: 323 ✭✭rounders


    It was the update from FarmOS1 to 2 I was more thinking about but guess that's not going to happen that regularly anyway



  • Registered Users Posts: 5,979 ✭✭✭emaherx


    Would be great to have sub form for custom code for Irish setup like what you mentioned about the CSV file from AgFood.

    I'm putting everything I put together on Git Hub https://github.com/Farmer-Eds-Shed/FarmOS-Node-Red-Flows

    I started putting a DAFM CSV importer together last night, it's almost finished, it reads the CSV file and creates the json objects that farmOS API should accept, I'm going to setup a test server later as I don't want to mess with my production server too much.


    Some of the marts issue files with their statement for uploading into Fullwoods software so maybe that could be leveraged.

    I'd be surprised if it is not a simple CSV file too.



  • Registered Users Posts: 5,979 ✭✭✭emaherx


    @rounders I've put together a CSV importer that works with DAFM CSV files, I also applied for and got API access from ICBF which will prove more useful in the near future, but for the moment generates CSV files that can also be uploaded to farmOS which saves the whole process of logging into Agfood/AIM every time I want to sync the herd profile. It still needs some refining but it's getting there.


    @patsy_mccabe ICBF API might suit you better than web scraping. I just contacted them and told them what I wanted it for, they asked me for a few details and gave me access within a few days. You need a domain name and static IP though, I use a free domain from DuckDNS and the static IP may depend on your ISP if it can be requested.



  • Registered Users Posts: 10,700 ✭✭✭✭patsy_mccabe


    How would that work exactly? I would be looking to import all the data for an animal in to MS Excel.

    'When I was a boy we were serfs, slave minded. Anyone who came along and lifted us out of that belittling, I looked on them as Gods.' - Dan Breen



  • Registered Users Posts: 5,979 ✭✭✭emaherx


    The API returns JSON formatted data, it's relatively simple to convert from JSON to CSV which can be opened by Excel.

    I'm using Node Red which is a visual programing tool that uses pre-built drag and drop nodes for common tasks and Javascript in special function nodes for anything custom.

    The following is an example of converting JSON to CSV using Javascript it is a loop which reads each record and writes them one line at a time to CSV.

    let outputMsgs = [];
    var csv;
    outputMsgs.push({payload:csv});
    
    msg.payload._embedded.live_weight.forEach(data => {
        
        csv = data.animal_id +","+ data.weigh_date + "," + data.weight + "," + data.weight_type + "," + data.price;   
            outputMsgs.push({payload:csv});
    
        })
    
    return [ outputMsgs ];
    
    

    There are JSON to CSV nodes too but a little bit of Javascript allows you to extract and format the data as you like.

    Authentication is the tricky bit though, but can be handled by Node Red too. The login process starts with a browser web login, then it sends a code to a URL hosted by Node Red on my server, this is used to request an access token which is needed for the API requests and a refresh token which is used to request a new access token and refresh without having to reauthenticate. The access tokens expire after a few minuets but refresh tokens last about 6 months, so you don't need to keep logging in through a web browser once connected.



  • Registered Users Posts: 10,700 ✭✭✭✭patsy_mccabe


    Thanks for that. I got the Webscraping working anyway using VBA and Selenium in MS Excel. I have it clicking the 'Replacement Index/terminal Index' button that comes up when you input a Tag Number into the ICBF Search Window. Managed to get that going just today, so that speeds thing up a lot. I also have it reading from the Limousin Herd Book database.

    The whole thing is automated now, so I just run the Macro in Excel. I'm not sure how an API works, to be honest.

    'When I was a boy we were serfs, slave minded. Anyone who came along and lifted us out of that belittling, I looked on them as Gods.' - Dan Breen



  • Registered Users Posts: 18,487 ✭✭✭✭_Brian


    After some unwelcome visitors on the farm recently we installed a few cheap webcams. €55 a piece I think they were. This one is in the 45year old slatted shed. On the very left you can see a 600l rain harvest tank feeding drinkers, it’s just fed of the down pipe, no filtering at all. Been there more than 15 years.


    small stock nearest eat at barrier, get meal in the yard and have access to a dry paddock all winter.



  • Registered Users Posts: 369 ✭✭Gman1987


    What app are people using to view PTZ camera's? I have a Floeuron PTZ here and have their app on the phone (cloudlens) but its brutal. You could move the PTZ on the phone and it would move almost straight away in the shed but you could be waiting 10-15 seconds for the picture to move on the phone so I'm looking for recommendations for alternative apps. current issue must be on the app/phone side as I have the camera's set up on a laptop also and their is no delay with the picture.



  • Advertisement
  • Registered Users Posts: 22 steer


    I use tiny cam Pro.Four cameras two PTZ.Find it good.



  • Registered Users Posts: 5,979 ✭✭✭emaherx


    What app are you using at the moment and how did you connect it?

    If it is connected by P2P then every command may travel from here to China and back before the camera moves as it depends on an external server. If you are not sure if it is P2P or not, basically if you just needed a UUID or QR code to set it up then it is most likely P2P. For the fastest possible connection then you need to configure the app with your routers address and use port forwarding to connect from outside your home network (or just the local camera IP if you only need access from within your home network).


    The port forward method also needs a static IP or else a dynamic DNS service.



  • Registered Users Posts: 5,979 ✭✭✭emaherx


    I'm sure you'd figure out the API if you needed it, but since you have what you need working with web scraping then happy days. I just thought of your ICBF project when I started on mine. I've a tag reader on the way, I am going to try and automate the cattle weighing over the summer.



  • Registered Users Posts: 5,979 ✭✭✭emaherx


    I bought a few Ruuvitags, they are Bluetooth Beacons which can measure movement, temperature and air pressure, they also have potential to be used for Indoor location tracking and have a battery life of about 2 years.

    I'm considering sewing some to the inside of calf jackets as health monitors for calves. Been doing a bit of experimenting making Gateways to collect the data from them over the last few days.


    Sample data collected from 2 test tags.




  • Registered Users Posts: 171 ✭✭Freejin


    Interesting project! I'm guessing temps won't be very accurate but I guess as long as you can see fluctuations would be the main thing.

    Know nothing of the ruuvitags , but do you think they will be robust enough to last inside a calf jacket?

    When you say you're making gateway yourself,how exactly are you doing that,raspberry pi or the likes?



  • Registered Users Posts: 467 ✭✭pms7


    Hi, I have an issue with a wireless bridge.

    I set up a Tenda wireless bridge last year using the automatic bridging method, where you place the 2 devices next to each other on power up and one becomes AP and other client without having to access settings.

    I am now trying to set up a second client working off the original AP. However I need to access the web UI to set password. I can access them when reset on 192.186.2.1 and instructions state after auto bridging the AP remains same and client is  192.186.2.2


    From instructions -  If the bridging succeeds, the DHCP servers of the two CPEs are disabled, and the IP address of the CPE working in Client mode changes to 192.168.2.2


    However these don't work.

    When I log in after reset and set as AP, same result. Looked up its IPv4 address, says its 192.168.88.14 this doesn't work.

    I can just use a second AP which would solve my problem, but I would like to avoid that and also know how to access them.


    From instructions -  Q1: I cannot log in to the web UI of the device by entering 192.168.2.1. What should I do? A1: Try the following methods and try again: − Ensure that the device has been connected to the power supply and the computer properly. − Ensure that the IP address of the login computer is 192.168.2.X (X ranges from 2 to 254).

    I didn't try the last suggestion as not that great with IP addresses and didn't see how it was needed if Tenda IP address stayed the same?



  • Registered Users Posts: 5,979 ✭✭✭emaherx


    Yes, I guess so too, only tested at the desk so far. There will be no calves here for about a month.

    Not entirely sure what to expect, I'm hoping the jackets themselves trap enough body heat to tell the difference between a calf with elevated temperature and the rest, I expect the base line will need to be set a little lower. Movement tracking can probably tell allot about which calves need extra looking out for too.

    There is a robust version too, although I've gone with some of the cheaper ones for now anyway, if they last long enough for proof of concept then the robust version can be considered, but I hope the jackets help protect them too.

    Yes Raspberry Pi for now, been experimenting with ESP32's as well, could end up with a Raspberry Pi as primary gateway and ESP32's as additional nodes to extend range and possibly indoor location tracking.

    Hope the calves like Marvel 😁 (Pocket may end up needing to be a net material if cloth is to insulating of temperature.)





  • Registered Users Posts: 5,979 ✭✭✭emaherx


    You can only access IP addresses on the same subnet as your laptop. Assuming all devices have a netmask of 255.255.255.0 (usually default), then the devices need to have the same first 3 octets, so all devices on 192.168.1.x can talk to each other, and same for 192.168.2.x, 192.168.88.x etc.

    Now you connect to the AP 192.18.2.1 while its DHCP is running it gives your laptop an address like 192.168.2.x also, but after you configure it, it turns off DHCP so it is no longer handing out addresses which is why you can no longer connect with the client. As a bridge it must turn off its DHCP as it would interfere with DHCP on your router.

    So realistically you need to manually set your laptop temporarily with an IP address in the 192.168.2.x range in order to configure additional devices.

    Where did you get the 192.168.88.14 address? If you need to connect your laptop to a device in this range then your address needs to be 192.168.88.x, the x part needs to be set to a number between 1 and 254 and be unique to your laptop so not 14.


    Hope this helps



  • Registered Users Posts: 467 ✭✭pms7


    Thanks a million for that emaherx, works. Able to login and see the password that was setup during auto bridging. So will be able to connect second client to old AP.



  • Advertisement
  • Registered Users Posts: 5,979 ✭✭✭emaherx


    Would it be worth changing that auto generated password, while you are at it? Some are not very secure as they use the same password every time. I know the ones I have always generate something like 666666666 as password, so even though the auto configure is convenient its completely insecure and you may be broadcasting your home network for miles, of coarse some brands may have better software to generate random passwords.



Advertisement