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.

1910111315

Comments

  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭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, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    image.png

    @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, Registered Users 2 Posts: 11,390 ✭✭✭✭patsy_mccabe


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



  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭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, Registered Users 2 Posts: 11,390 ✭✭✭✭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.



  • Advertisement
  • Registered Users, Registered Users 2 Posts: 18,974 ✭✭✭✭_Brian


    6957BD97-301A-4970-82E0-322F76B9FF5B.jpeg

    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, Registered Users 2 Posts: 388 ✭✭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.



  • Registered Users, Registered Users 2 Posts: 22 steer


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



  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭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, Registered Users 2 Posts: 6,484 ✭✭✭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.



  • Advertisement
  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭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.

    image.png




  • Registered Users, Registered Users 2 Posts: 182 ✭✭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, Registered Users 2 Posts: 486 ✭✭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, Registered Users 2 Posts: 6,484 ✭✭✭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.)

    image.png





  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭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, Registered Users 2 Posts: 486 ✭✭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.



  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭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.



  • Registered Users, Registered Users 2 Posts: 486 ✭✭pms7


    That's a good point, it looked random, mixture of numbers and letters but I'll know for sure when I get back to log into the original one.



  • Registered Users, Registered Users 2 Posts: 18,974 ✭✭✭✭_Brian


    Daughter was saying she was interested in looking at some electrical engineering stuff.

    Got her one of the elegoo arduino kits for Christmas. We’ve only done a bit with it but I could see it being addictive.



  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    Very good @_Brian if she's an interest in electronics it's a great place to start, those elegoo sets are good value too.



  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,162 ✭✭✭Dinzee Conlee


    Hello folks…

    Looking for a bit of help…

    A524C501-BD6E-44E5-92F8-3F425427C2DA.jpeg


    Found this in the back of the shed today. It’s a 6volt battery fencer.

    Been a nice few years since twas last used. Was working when twas put in, but you couldn’t keep batteries in it…

    Be useful if I could get it running on a car battery. But, a car battery is 12v - and the fencer is 6v. Is there any bit of guntering I could do to make it work?

    Thanks in advance…



  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    12V-6V Buck stepdown converter.

    12V car batteries, probably won't last as long as electric fence batteries, but obviously they are rechargeable, a small solar panel would keep it going a bit longer though.



  • Registered Users, Registered Users 2 Posts: 2,162 ✭✭✭Dinzee Conlee


    Cheers Emaherx, will get me one of those…

    Will an old tractor battery do my job? Old as in was too far gone to start the tractor - will it hold enough charge for the fencer?

    What kinda solar panel should I get?


    EDIT : I just thought I have one of these in an old kids bike in the garage.

    B3446545-FAB0-482B-B383-9554E1784988.png

    Could I use that with a solar panel? Be handier than lugging a car batter too…

    Post edited by Dinzee Conlee on


  • Registered Users, Registered Users 2 Posts: 1,171 ✭✭✭minerleague


    When I saw your photo I was thinking " I've seen a battery like that before " So went rooting and I found a big torch that Uncle had years ago. Battery is rechargeable but it says to not let it be flat for long. Comes with a plug to recharge. Will try it later - Output should be 6-8v DC I presume? I wonder can you get them batteries still?



  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    Is it old? you'd probably have better luck with an old tractor battery than an old one of them. If it is good you can get (6V) panels/charge controllers, might not be a bad option keeping everything 6V. But might be most useful in summer months.

    A 30W panel with charge controller (12V) would keep a tractor battery going most of the year on electric fence up to about 4Joules



  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    Can definitely still get those batteries.

    Should be 7V+ charged I'd imagine.



  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    I bought one of these https://www.priority1design.com.au/shopfront/index.php?main_page=product_info&cPath=1&products_id=12 about 12 months ago. Probably about time I opened the box :D. Took it out today and connected it up it reads the tags no problem, got it sending Tag ID's into Node-Red. Need to make an enclosure for it now and make it wireless.

    They've cheaper options too, https://www.priority1design.com.au/shopfront/index.php?main_page=product_info&cPath=1&products_id=8 would have weent with this one only there was no stock at the time.



  • Registered Users, Registered Users 2 Posts: 486 ✭✭pms7




  • Registered Users, Registered Users 2 Posts: 6,484 ✭✭✭emaherx


    Read Tags 😁


    Smartify the scales for a start....

    image.png




  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,122 ✭✭✭148multi


    Yes, I believe clulite sell them or the 6v 3ah ones used in alarms



Advertisement