Author Topic: Understanding GitHub  (Read 4447 times)

0 Members and 1 Guest are viewing this topic.

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2076
  • Country: us
Understanding GitHub
« on: April 30, 2021, 03:49:07 am »
I'm uncertain if GitHub is normally confusing, or if it's related to the Marlin firmware for the Anet A8 printer.

Pertaining to this section: https://github.com/MarlinFirmware/Marlin

The right side shows the 'latest' version is Marlin 2.0.7.2 as of Oct. 30, 2020.

If I click on 'all branches' I see 2.0.x that's dated March 24, 2021 and it's listed as default. Underneath is another file named bugfix-2.0.x dated April 28, 2021. To the right is commits ahead, commits behind.

If the latest version is 2.0.7.2, then why is the date older than 2.0.x? I expected to see a list of versions with the latest being on top, however, this seems extremely confusing as to what is the latest and released (?).
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3249
  • Country: us
Re: Understanding GitHub
« Reply #1 on: April 30, 2021, 04:08:23 am »
Quote
If the latest version is 2.0.7.2, then why is the date older than 2.0.x?

"2.0.x" refers to a branch which is a line of development -- not a specific version. Commits are continually being added to the "2.0.x" branch. At some point in time a snapshot of the branch is given a tag -- like "2.0.7.2".

You can view all of the tags by clicking on the "tags" tab in this menu:

1215689-0

The current state of the "2.0.x" branch may not be ready for public consumption. The developers will tag a branch and make a release when they feel it is safe for others to use that version of the code.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2076
  • Country: us
Re: Understanding GitHub
« Reply #2 on: April 30, 2021, 04:28:36 am »
This somewhat helps as I have some experience with released versus unreleased revision control stuff.

Am I correct in saying that the 'branch' list that shows 2.0.x Updated Mar 24, 2021 by ldursw under the 'all branch' tab is an unreleased version even though it's newer than the 2.0.7.2?

If I understand correctly, if I didn't know any better, the ONLY way to tell that 2.0.7.2 is the most recent released version is by looking on the right side where it shows 2.0.7.2 is the latest as of Oct. 30, 2020 and under it (as of the time I'm tying this) 42 releases (which I can click on and see previous releases)?

What does the commits ahead/behind mean?
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3249
  • Country: us
Re: Understanding GitHub
« Reply #3 on: April 30, 2021, 05:09:20 am »
Quote
What does the commits ahead/behind mean?

This message about the "bugfix-2.0.x" branch:

Quote
This branch is 1262 commits ahead, 207 commits behind 2.0.x.

means that there are 1262 commits which were applied to the "bugfix-2.0.x" branch but not the "2.0.x" branch and 207 commits applied to the "2.0.x" branch but not the "bugfix-2.0.x" branch.

At some point in the past there was only one branch (probably named "2.0.x") and the "bugfix-2.0.x" was created starting at where the "2.0.x" branch was. These numbers give you stats on what has transpired since that split.

 

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1344
  • Country: pl
Re: Understanding GitHub
« Reply #4 on: April 30, 2021, 10:13:48 am »
I guess the confusion comes from seeing two separate things, which GitHub mixed together: git and their own services.

“Branches” refer to git and they describe organization of the repository, as used by developers. “Releases” are GH’s feature, which is nothing more than a downloadable archive of files someone has published, not necessarily directly related to the git repository itself.
People imagine AI as T1000. What we got so far is glorified T9.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2076
  • Country: us
Re: Understanding GitHub
« Reply #5 on: April 30, 2021, 02:19:05 pm »
But what is "commit"?

Looks like a new version is out (2.0.8). From this recent change, I can see that "tags" is showing me (what I believe to be) the actual released versions.

I'm guessing branch will be what has branched off (in this case) 2.0.8), but not released?
 

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1344
  • Country: pl
Re: Understanding GitHub
« Reply #6 on: April 30, 2021, 03:26:26 pm »
As written above: “release” is a GitHub-specific feature, a downloadable archive uploaded to GitHub by the maintainers of the project. Its metadata is whatever the uploader chooses and is not related, in purely technical means, to what is in the git repository. It may refer to commits and tags in the repository, but it’s uploader’s choice. git itself has no concept of releases.

A commit, in version control, is a single snapshot of the complete development tree (directories and files).

A tag, in git, is an arbitrary label that may be applied to a commit to make management of stuff easier.
« Last Edit: April 30, 2021, 10:13:25 pm by golden_labels »
People imagine AI as T1000. What we got so far is glorified T9.
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1768
  • Country: se
Re: Understanding GitHub
« Reply #7 on: April 30, 2021, 05:41:10 pm »
But what is "commit"?
Some questions on branches, and tags have been answered in this thread.

I agree with golden_labels, mixing up GitHub (and their process/services) with git is quite common - and understandable in a way.
Just remember that GitHub is not the only service based on git, Gitlab and bitbucket are examples of other offerings for similar services.

I recommend to read the book to get acquainted with git, or if you prefer a lighter approach, Oh my git!: a gamified tutorial, but using the real thing under the hood, with the option of solving the puzzles using an actual command line.
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2076
  • Country: us
Re: Understanding GitHub
« Reply #8 on: July 04, 2021, 03:58:52 pm »
I'm uncertain whether to post my new question in this thread or start new. Since it's related to my original question, I'll begin here.

Looking through the latest firmware version (https://github.com/MarlinFirmware/Marlin/releases/tag/2.0.9.1) and the same with past versions, I'm uncertain which are the actual firmware code.

The reason I ask this: it's "open source" code, and some safety factors have been put into place. I'd like to review the code to see what types of protection is incorporated and how it's being protected. Since I'm not familiar with code, nor do I know what language it was created in, I'm uncertain which files do what job and which is the actual code.
 

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1344
  • Country: pl
Re: Understanding GitHub
« Reply #9 on: July 05, 2021, 07:16:14 am »
Looking through the latest firmware version (https://github.com/MarlinFirmware/Marlin/releases/tag/2.0.9.1) and the same with past versions, I'm uncertain which are the actual firmware code.
The assets at the bottom.

The reason I ask this: it's "open source" code, and some safety factors have been put into place. I'd like to review the code to see what types of protection is incorporated and how it's being protected. Since I'm not familiar with code, nor do I know what language it was created in, I'm uncertain which files do what job and which is the actual code.
A summary is in the release notes page itself. The exact list of all commits to a selected tag can be seen by using “Compare” (top-left on wide displays, top-right on narrow displays).
People imagine AI as T1000. What we got so far is glorified T9.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2076
  • Country: us
Re: Understanding GitHub
« Reply #10 on: July 05, 2021, 01:59:26 pm »
Quote
The assets at the bottom.


I saw and downloaded that before posting, however, several files are in that zip. I'm uncertain which files are actual code and which ones are other stuff.
 

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1344
  • Country: pl
Re: Understanding GitHub
« Reply #11 on: July 06, 2021, 01:34:35 am »
The file contains a snapshot of the whole repository.
People imagine AI as T1000. What we got so far is glorified T9.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2076
  • Country: us
Re: Understanding GitHub
« Reply #12 on: July 06, 2021, 02:57:05 am »
By snapshot, do you mean all the files?

I downloaded the zip, and see 2,344 files, but which file (or files) is the actual code and what is the need for all the other files?

Also, is this Python?
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3043
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: Understanding GitHub
« Reply #13 on: July 06, 2021, 03:06:30 am »
Marlin is written in C C++

You will find the code for Marlin in the Marlin/src subdirectory of the repository.

« Last Edit: July 06, 2021, 03:08:55 am by sleemanj »
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2076
  • Country: us
Re: Understanding GitHub
« Reply #14 on: July 06, 2021, 03:17:00 am »
Okay, thanks.

I don't know C++ (just some basic C), nor do I know how to deal with the many header files.

The scr directory has many sub-directories that also contain source and header files. I was hoping to see the line(s) that tells the system to turn off both the bed and extruder header should an issue occur with the thermistor.

 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3043
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: Understanding GitHub
« Reply #15 on: July 06, 2021, 03:21:58 am »
Youa re talking about Thermal Runaway

A quick grep of my Marlin installation reveals these relevant files

Code: [Select]
src/gcode/host/M115.cpp
src/inc/Conditionals_adv.h
src/inc/Conditionals_post.h
src/inc/SanityCheck.h
src/module/temperature.h
src/module/temperature.cpp

Search them for THERMAL_PROTECTION

Particularly in temperature.cpp
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2076
  • Country: us
Re: Understanding GitHub
« Reply #16 on: July 09, 2021, 03:02:14 am »
Thanks for the help.

Unfortunately I know such little C (and nothing of C++) that I can't follow the code.

I'm limited to the first few chapters of C.
 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 8765
  • Country: fi
Re: Understanding GitHub
« Reply #17 on: July 09, 2021, 01:02:58 pm »
You can't do even a remotely serious safety assessment of the code if you don't know even the basics of the language used.

Such safety analysis is a massive task, anyway. Get someone really experienced to do it, and it will still take so much time and effort the cost will be in $ tens of thousands absolute minimum.

Seriously, I would consider saying "no I can't" if somebody asked me to prove it safe to use. Looking for obvious unsafe aspects would be already easier.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2076
  • Country: us
Re: Understanding GitHub
« Reply #18 on: July 09, 2021, 01:19:32 pm »
I believe it's "safe" to use.

I was more interested in knowing how the heaters are handled.

If you're unaware, the printer has a hot bed (approximately 60 degrees C) and an extruder (approximately 200 degrees C). If the thermistor in either circuit opens due to a broken wire, the (original) firmware turns on the heater and you have thermal runaway until it catches fire.

I was curious whether it monitors both a shorted and open thermistor, how long before it shuts down the heaters should one thermistor open, and/or any other safety protocols that are put into place.

Edit: you're correct though, if I don't know the code, I'm wasting my time, however, I wanted to attempt understanding the code rather than just post a message asking people to read it for me.

 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 8765
  • Country: fi
Re: Understanding GitHub
« Reply #19 on: July 09, 2021, 02:29:24 pm »
Yes I'm aware of the original issue, the fires were such commonplace that one occurred at the university where I worked as well.

I'm sure they have patched the most obvious issues but the devil is in the details and at some point, the key is not to try to make the code perfect; the cheap microcontroller itself can crash and stop executing code leaving the heater on, anyway, or a voltage transient kills the MOSFET short-circuit; instead, true redundant safety systems are needed. Which is a ridiculous omission; almost any heating system capable of producing dangerous temperatures if stuck on classically uses a simple thermal fuse in series with the heater, or controlling a relay/contactor. The key is to verify this protection works reliably even if the code turns the heater full on all the time, and put most of the effort in proving that since it's orders of magnitude easier problem than proving a computer system (including HW and SW!) never does anything wrong.
« Last Edit: July 09, 2021, 02:31:09 pm by Siwastaja »
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2076
  • Country: us
Re: Understanding GitHub
« Reply #20 on: July 09, 2021, 02:41:44 pm »
You're correct, I'd like to see more hard wired safety features rather than just firmware.

I've considered installing a thermal fuse, but the printer is so tight and upgrades are a pain.

I also considered a box with a smoke detector, but I don't use the printer often. No matter what printer this is, I'd still never leave printing unattended. It's similar to people who let homemade pasta sauce simmer on their stove for house while they leave the house. Absolutely crazy in my opinion.

Even worse: the more you know about electronics and tinker with stuff, the more you realize how easy something can fail causing catastrophic damage.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2076
  • Country: us
Re: Understanding GitHub
« Reply #21 on: August 16, 2021, 03:42:57 am »
I don't know if this is a Github question, a printer question, or firmware upgrade question.

I've watched several YouTube videos and done lots of reading. Using Aurduino and reading online, I managed to install a bootloader (Anet 1.0 optiboot).

At this stage my Anet A8 board is just showing stars on the screen; I assume because the firmware has been overwritten by the bootloader.

Moving forward, I downloaded Marlin Marlin-2.0.9.1 and Configurations-2.0.8.2. According to the tutorial, I need to copy _Statusscreen, Configuration, Configuration_adv in the Configurations folder (after unzipping it) and paste it in the Marlin folder (also after upzipping it) and overwrite any of the three files that are older.

Using Visual Studio Code, I installed the necessary add-ons, opened the Marlin folder, attempted to build it, and got the option to build Sanguino1284P or Sanguino1284P_optimized.

First baffling thing is what is the difference (I can't find anything about this online).

Second and bigger issue: the build is failing. I'm getting a Configuration.h file is an old version and needs to be upgraded or downgrade Marlin.

Marlin and the Configurations file are the most recent versions on GitHub (at least from how I interpret it).

I'm uncertain what I'm doing wrong or need to do as I can't find anything online.

On a side note, if anyone has experience with the Anet A8, maybe this question can also be answered (if not, I'll dig deeper if possible) I'm assuming Marlin, by default, has all the normal settings for the printer with some safety upgrades. From reading, it almost seems like I'm suppose to set things like endstops. I'm a bit scared to tinker with anything because I don't understand C++ code. As for features such as enabling auto bed leveling, I assume after some deeper research, I'll know which lines to edit for enabling.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2076
  • Country: us
Re: Understanding GitHub
« Reply #22 on: August 23, 2021, 03:18:24 am »
I am very confused.

I believe the 3D Printer topic isn't very active or nobody uses Marlin.

Anyway, I've downloaded the current versions of Marlin and the Configurations, yet, when I try building, I get: configuration.h file is for an old version of marlin

Unless I'm reading Github wrong, the latest versions are: Marlin-2.0.9.1 and Configurations-2.0.8.2.

Should I be downloading Marlin 2.0.8.2? If so, why would someone not also create a Configurations-2.0.9.2 since that's the Marlin version?
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3043
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: Understanding GitHub
« Reply #23 on: August 23, 2021, 05:17:34 am »
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf