Esp8266 + mqtt + jsn-sr04t

Hello @pierre-gilles

I just finished the markdown file. I also gave you access on Github so you can see the result.

There are still modifications to be made to the syntax, for example. It also automatically changes some words for me and I don’t know how to do it. Trigger modified to trigger or it also removes words sometimes « For this, … » removal of this

I would also like to highlight sentences and put words in red but I haven’t found out how to do it yet

Can you help me?

This should help you

Where did you give me access? I don’t see it anywhere :slight_smile:

Sorry, on GitHub:

Jérôme-Gladys/Remaining-Capacity-of-a-Tank

Hopefully it works

Great!

  • For the images, you should put them in the repo and not upload them to GitHub.
  • Do you feel like making a PR afterward? :slight_smile: We can help you, of course.

I put the images in the repo but then I need to change the code lines afterwards?

I’m excited to try the PR, is it a good practice or do you have any advice?

Yes! You need to put the images in markdown format :slight_smile: Here’s an example of a markdown file on the site:

(You click on « raw » to see the pure markdown)

To make a PR, as far as I know, it is possible to make a PR in the Github UI directly, without command lines or anything.

What you need to do is first « fork » the Gladys site repo:

This will create a git repo on your Github account.

Then, you can modify this repo as you wish (and add content, images, etc.)

Then, you will need to create a pull request from your modifications.

Example:

There are many resources on the internet that talk about PRs so if you have any trouble don’t hesitate to check out the Github documentation which is very rich :slight_smile:

If you have any trouble, worst case we’ll do it for you but if you can learn something it’s always a good thing :slight_smile:

I’m struggling to put the images in markdown format.

I think it must be my path that’s not correct but I’ve tried everything. A little help to correct me.

Is this the correct markdown image format?

![assembly diagram](img/image diagram.png)

Are you talking about the Gladys site repo or your own repo?

Have you forked it yet or not?

On my repo for now. I wanted to finish it first.

I had already forked it before but that’s all, I will start the PR afterwards.

Yes, that’s correct :slight_smile:

Look at the example I gave you in the Gladys site repo for inspiration

I just made a pull request.

However, I’m stuck on integrating the image from the repo. I followed the example, searched the web, and tried a bunch of path examples but I can’t get it to work.

A little help with the first image would be great and I’ll do the rest afterward :wink:

Have you looked at the examples on the site?

For example, this page from the documentation:

https://github.com/GladysAssistant/v4-website/blob/master/docs/dashboard/devices-in-room.md

If you click on « Raw », it displays the markdown content of the file:

You have an example of where to put the images, and some formatting :slight_smile:

Yes, I looked at and followed the example. I made a little progress, but the image still doesn’t display.

It says the page is not found, so there must be an error

RAW file preview

The schema image is located at this level on GitHub

Capture d’écran 2021-04-10 à 09.59.05

Hello @jerome we’ll get there these « problems » are normal.

The changes you made were not pushed to the correct branch.

  • fork of the main repo (that’s done)
  • creation of a branch (that’s done)
  • clone of the fork on your PC?
  • did you switch branches?

Now you need to make your modifications and commits/push

Then make the pull request, and that’s where you made a mistake because you made the request on your own fork, you need to make the request on the main repository.

The image exists but on another branch

The site needs to be generated to be functional, your file is OK

Thanks @VonOx for your help.

  • Clone the fork on your PC? Done
  • Switch branch? Done
    Now you need to make your changes and commits/push. Done
    Then make the pull request, and that’s where you made a mistake because you made the request on your own fork, it’s on the main repository that you need to make the request. Done

I think that’s it. If you could check or @pierre-gilles.

Yes, that’s okay. The PR is visible.

Got it :slight_smile: I’ll check tomorrow

Hello! Thanks in advance for your work :slight_smile:

I looked at your PR, we’re a bit far from the expected result honestly :smiley: (no offense, when you’re not familiar with node development, git, etc., it’s not easy)

Before even talking about the PR, I quickly read the Arduino code, are you sure it works?

It seems very messy to me:

  • There is a JSON serialization of the data, while the Gladys MQTT API does not take JSON
  • There is no place where the data is sent via MQTT
  • You are using the « ESP8266WifiMulti » package, why?
  • The code is a mix of English and French, there are many variables defined but unused.

Either you got the wrong file, or it never worked for you ^^
I think it would be worth taking a pass on the code to make it cleaner.

Regarding the publication of this tutorial, I wonder if it’s the right strategy to ask you to publish it on the site. Maybe posting it in the « Tutorials » section of the forum would be sufficient and easier for you: Tutoriels - Gladys Assistant community

Because as it stands, the PR on Github is far from working, I would say there are 3-4 hours of work, and you who may not have the skills, it might take you a lot of time (and especially learning other technologies), I may have underestimated the necessary skills/the learning curve to write a post on the site.

Don’t take it the wrong way, I’m trying to find the best compromise ^^

Let me know what you think :slight_smile: