Meshtastic

Arduino project coded?

Been messing with Arduino coding for quite some time. Also programmed in Python on Raspberry Pi.
So I was expecting an Arduino project .ino file to load for this. I can’t find one. What development software do i need to take a look at the code as an entire project for this?

1 Like

PlatformIO is what you are after.

1 Like

Also this might be helpful: https://github.com/meshtastic/Meshtastic-device/blob/post1/docs/software/build-instructions.md

followed instructions in your doc:
opened the terminal in Visual studio code
typed in>> git submodule update --init --recursive
And it chucked back an error like below.
Thanks geekville. I think i need to go away and learn a bit more about how github works.

PS C:\Users\andre\Downloads\Meshtastic-device-0.9.1\Meshtastic-device-0.9.1> git submodule update --init --recursive
fatal: not a git repository (or any of the parent directories): .git
PS C:\Users\andre\Downloads\Meshtastic-device-0.9.1\Meshtastic-device-0.9.1>

1 Like

Hi, good attempt! It seems you are missing an initial step (which our instructions also missed ;-)).

new step 1: Clone the Meshtastic-device sourcecode from github and cd into the project directory.

git clone https://github.com/meshtastic/Meshtastic-device.git
cd Meshtastic-device


Success!! well nearly, It complied for the wrong board, I have a tbeam. Sorry you, probably have better things to do than nurse me through getting the compiler to work for me. But where do i tell it what board to compile for? This is a new method of compiling from my normal Arduino where i would comment in the correct board to #include

1 Like

the easiest thing in your case I think is just to edit this line in platformio.ini:

default_envs = tbeam 

Ah given up on Visual Studio code. Had it assembling, but for the wrong board. Changed the platform. ini as suggested. but the change would not stick. Messed around with a few settings now all i get is this pop up whenever i try to start debugging. uninstalled the program, re installed it and the same error. It seems i am getting to old and less time to figure this one out. Used so many compilers in the past. But this one is either so simple or so overly complicated that i just don’t have the self teaching skills to have a clue how to use the dam thing. So frustrating.

I feel your pain. I’m sure it is a really powerful tool when you know how to use it! When changes don’t “stick” I sometimes have to click “Rebuild IntelliSense Index” but all this really does is update the coloured and grayed out code I think.
image

I’ve also started a little guide here that would be great to get some more input too.

2 Likes

Sorry, I know this is about Meshtastic. But having real bother with V.S.C . once i load folder Meshtastic-device-post1. Everything loads into V.S.C. pressing F5 (start debugger) then VSC ask to select which environment. Which one do i choose.?As when i select a C++ one it just adds a launch.json with no real details.With arduino it’s just assemble and download to device. I am sure with more use i will understand what VSC is capable of and understand why it is not so straight forward from the start. I just want to download your code from github assemble it and load it into my t-beam. I have downloaded the bin file and loaded that into the device. As a coder of arduino, i really would like to mess with the code. But i just can’t get this simple task of assembling it even, with Visual Studio Code. very fustrating

Is there a reason you are trying to build using the VSC debugger option? Have you tried building through PlatformIO as described here, step 8?

1 Like

Ah yes, that’s how i did it from the beginning. However that method no longer works, as PIO RUN is not recognised. From research, Seems it has something to do with I have python 3 and not 2 installed. Strange how it all worked before. So stuck again now. Life really should not be this hard. Really would like to stick with Arduino, as this is all a bit of a head ache learning curve.

// the max length of this buffer is much longer than we can possibly print

static char tempBuf[96];

assert(mp.decoded.which_payload == SubPacket_data_tag);

snprintf(tempBuf, sizeof(tempBuf), "         %s", mp.decoded.data.payload.bytes);

display->drawStringMaxWidth(4 + x, 13 + y, SCREEN_WIDTH - (6 + x), tempBuf); /// i changed from 10 to 13 to 

// resolve issue with Yellow/blue  split display cutting the top row of txt in half with gap in middle
1 Like

Had a problem with OLED yellow/ blue splitting the txt msg across the yellow and blue filter which has a three line gap in. Fixed it with changing your code. Getting to grips with Visual studio code now. However can’t see a setting for save before debug and upload? So have to remember to save all before assembling and uploading

All my programming skills are self taught, so learning curve is steep for me. How do we make changes to be considered by yourselves as a worthy latest release? I am thinking Github has something to do with how improvements are implemented. But with so many ideas and tangent the development could go. There must be some sort of central decider? I am very interested in the development of this project, but at the same time trying to understand how all the changes are implemented , as this is the first project i would like to be involved in it’s evolution.

1 Like

// coordinates for the center of the compass/circle

int16_t compassX = x + SCREEN_WIDTH - COMPASS_DIAM / 2 - 5, compassY = y + SCREEN_HEIGHT / 2 + 6; // added 6 to move it into blue area

changed this so compass circle is in blue area and not spanning yellow area. Think other parts will need editing such as the ? and the pointer to centre them into the new location of circle.

Though drawString will wrap onto multiple lines. But you are right it wastes someRAM

oh great! As far as the ‘central decider’ mostly that’s any of people who are blessed to review pull-requests (which currently is just me and @Professr). We are friendly and happy to help you come up to speed in the ways of github. Here’s some initial comments:

  1. A good summary on how to send in your first “pull request”: https://www.freecodecamp.org/news/how-to-make-your-first-pull-request-on-github-3/
  2. For obvious bugs with simple fixes, you can just send in a pull request. For new features or anything kinda complex probably best to first make an issue so other folks can give feedback on your approach/idea (before you bother coding it) - but that’s optional.
  3. When changing source files, try to only change the lines that you need (i.e. don’t do a big reformatting of the file - because then it makes it hard/impossible to review the pull request). We recommend using the Visual Studio Code editor with the platformio plugin (see the platformio site for a download link). That editor will auto format lines matching our convention.
  4. If you have other questions either post here or if you want more of a live chat (when others happen to be online - mostly the weekends) our devchat slack is here: https://app.slack.com/client/T0178GSES9E/C0163V5NC79
1 Like