# Best practice to implement new firmware?

**URL:** <https://forum.farmbot.org/t/best-practice-to-implement-new-firmware/9292>\
**Category:** Raspberry Pi\
**Created:** [September 11, 2024, 9:03am UTC](https://forum.farmbot.org/t/best-practice-to-implement-new-firmware/9292 "2024-09-11T09:03:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![neo](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/n/9fc348/32.png) [@neo](https://forum.farmbot.org/u/neo)\
**Post date:** [September 11, 2024, 9:03am UTC](https://forum.farmbot.org/t/best-practice-to-implement-new-firmware/9292/1 "2024-09-11T09:03:06Z")

</div>

I am on the Raspberry Pi 3 and I wrote code to read out I2C sensors using the F52.  
This works fine when I flash the firmware onto the farmduino using my laptop. However I would like the Pi to upload this new firmware everytime it starts. Therefore I would like to now how to replace the current firmware with my newer version. What is the best way to do just that ?

On top of that I would like to be able to tell the farmduino to read out an I2C Sensor from the WebApp and also to get the data delivered back to the WebApp. Where can I add this functionality ?

---

<div class="post-metadata">

**Author:** ![jsimmonds](https://forum.farmbot.org/user_avatar/forum.farmbot.org/jsimmonds/32/1470_2.png) [@jsimmonds](https://forum.farmbot.org/u/jsimmonds)\
**Post date:** [September 12, 2024, 5:29am UTC](https://forum.farmbot.org/t/best-practice-to-implement-new-firmware/9292/2 "2024-09-12T05:29:37Z")

</div>

Welcome @neo

> [@neo](#):
>
> I would like the Pi to upload this new firmware everytime it starts.

The FarmBot Inc. **farmbot-arduino-firmware** respository seems to be missing **Contributor** guidelines documentation.

Summary

- Sign a Contributor Agreement
- Fork the repository
- Create a new branch where you will put your modified source code
- Create Test(s) where possible
- Create a new Pull Request
- Wait for response(s) from repository owner

The **farmbot-arduino-firmware** respository has **1** Open Pull Request relating to F52

---

<div class="post-metadata">

**Author:** ![jsimmonds](https://forum.farmbot.org/user_avatar/forum.farmbot.org/jsimmonds/32/1470_2.png) [@jsimmonds](https://forum.farmbot.org/u/jsimmonds)\
**Post date:** [September 12, 2024, 6:10am UTC](https://forum.farmbot.org/t/best-practice-to-implement-new-firmware/9292/3 "2024-09-12T06:10:46Z")

</div>

> [@neo](#):
>
> On top of that I would like to be able to tell the farmduino to read out an I2C Sensor from the WebApp and also to get the data delivered back to the WebApp. Where can I add this functionality ?

This requirement will need _many_ source modifications (including db schema).  
Start by reading the **farmbot\_os** code for handling reading a **Sensor** (a named\_pin type)  
Ask FarmBot Inc whether the value(s) should be stored in the **sensor\_readings** database and which sources in the Web App will need modification.

---

<div class="post-metadata">

**Author:** ![neo](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/n/9fc348/32.png) [@neo](https://forum.farmbot.org/u/neo)\
**Post date:** [September 12, 2024, 1:46pm UTC](https://forum.farmbot.org/t/best-practice-to-implement-new-firmware/9292/4 "2024-09-12T13:46:00Z")

</div>

Thank you for your answer!  
I was hoping for a somewhat easier approach since I found the following on the official farmbot website:  
 ![image](https://forum.farmbot.org/uploads/default/original/2X/2/2b00f269d74030908ecc9fbf204f6e21c269e3cc.png)

This however did not work for me since I was not able to copy any files onto the SD-card with the farmbotOS on it.

---

<div class="post-metadata">

**Author:** ![jsimmonds](https://forum.farmbot.org/user_avatar/forum.farmbot.org/jsimmonds/32/1470_2.png) [@jsimmonds](https://forum.farmbot.org/u/jsimmonds)\
**Post date:** [September 12, 2024, 2:28pm UTC](https://forum.farmbot.org/t/best-practice-to-implement-new-firmware/9292/5 "2024-09-12T14:28:19Z")

</div>

> [@neo](#):
>
> hoping for a somewhat easier approach since I found the following on the official farmbot website

Oh, Ok, sorry. I assumed that you wanted to contribute your modified software to the FarmBot Community 🙂

That **custom.hex** procedure _ **should work** _ … I used it on my bot recently.  
What was the OS that you plugged the FBOS SDHC card into ?

---

<div class="post-metadata">

**Author:** ![neo](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/n/9fc348/32.png) [@neo](https://forum.farmbot.org/u/neo)\
**Post date:** [September 12, 2024, 2:36pm UTC](https://forum.farmbot.org/t/best-practice-to-implement-new-firmware/9292/6 "2024-09-12T14:36:27Z")

</div>

In the long run I might want to contribute the modified software but for the moment I want to make sure it really works as intended.  
The OS I was using is a Linux distro (Pop\_os, running on Ubuntu 22.04).  
I am able to view the files but I do not have the the necessary rights to write to the card.

---

<div class="post-metadata">

**Author:** ![jsimmonds](https://forum.farmbot.org/user_avatar/forum.farmbot.org/jsimmonds/32/1470_2.png) [@jsimmonds](https://forum.farmbot.org/u/jsimmonds)\
**Post date:** [September 13, 2024, 4:21am UTC](https://forum.farmbot.org/t/best-practice-to-implement-new-firmware/9292/7 "2024-09-13T04:21:13Z")

</div>

> [@neo](#):
>
> do not have the the necessary rights to write to the card.

Ok, did you try the file copy using **sudo**?

Edit: On my Linux PC (debian 12) my FBOS SDHC card is auto-mounted and I see 2 directories

- **BOOT-A**
- **disk**

That BOOT-A folder is where you put your **custom.hex**

---

<div class="post-metadata">

**Author:** ![neo](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/n/9fc348/32.png) [@neo](https://forum.farmbot.org/u/neo)\
**Post date:** [September 13, 2024, 9:52am UTC](https://forum.farmbot.org/t/best-practice-to-implement-new-firmware/9292/8 "2024-09-13T09:52:32Z")

</div>

Thank you for the answer! That is where I went wrong…

---

<div class="post-metadata">

**Author:** ![system](https://forum.farmbot.org/user_avatar/forum.farmbot.org/system/32/4564_2.png) [@system](https://forum.farmbot.org/u/system)\
**Post date:** [October 13, 2024, 9:53am UTC](https://forum.farmbot.org/t/best-practice-to-implement-new-firmware/9292/9 "2024-10-13T09:53:15Z")

</div>

Closed on October 13, 2024, 9:53am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
