GithubHelp home page GithubHelp logo

danieltobon43 / hx711-esp-idf-library Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 1.85 MB

C library for the esp32 using esp-idf framework

Home Page: https://raw.githubusercontent.com/danielTobon43/hx711-esp-idf-library/master/m9.jpg

CMake 1.69% Makefile 2.32% C 95.99%
c esp32 esp-idf cmake hx711 sparkfun

hx711-esp-idf-library's Introduction

esp-idf project

Structure

- Project-ESP-IDF/
            - CMakeLists.txt
            - sdkconfig
            - Makefile
            - components/	-esp_idf_lib_helpers/	                         
            - main/	- src/	- modules/	
            			- ota/	
            			- states/						
				- main.c               		
   			- html/	
   			- include/
	   		- server_certs/
            - build/
            - example/

Test

$ cd /NBIOT-Arduino-master/Project-ESP-IDF
$ add esp-idf to the path env
$ idf.py build && idf.py -p /dev/ttyUSB0 -b 115200 flash monitor

WEB SERVER

$ Go to the ip: 192.168.4.1


$ Set your own wifi ssid 
$ Set your own wifi password (if not password leave the blank space)
$ Press submit button

Output example

	*** MAIN PROGRAM ***
	
	-> wakeup caused: user button
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
	STATE 1: user button = yes
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

	~~~~~~~~~~~~~~~~~
	     AP MODE     
	~~~~~~~~~~~~~~~~~
	-> setting event loop
	-> setting wifi config options
	-> setting mode: AP
	-> starting wifi access point
	-> parameters:
	-> ipv4: 192.168.4.1 
	-> mask: 192.168.4.1 
	-> gw: 192.168.4.1 
	*** OK ***

	~~~~~~~~~~~~~~~~~
	    WEB SERVER   
	~~~~~~~~~~~~~~~~~
	-> setting http default config
	-> setting server on port 80
	-> setting http get method
	-> setting http post method
	*** OK ***
	-> waiting for the user input on web server ***
	-> please go to the web server IP: 192.168.4.1 
	-> waiting...

	-> reading data from web server

	-> data received: 
	 ssid: New_Frontiers 
	 password: none 

	~~~~~~~~~~~~~~~~~
	     STA MODE    
	~~~~~~~~~~~~~~~~~
	-> setting event loop
	-> setting wifi config options
	-> Configuring wifi without user password...
	-> setting mode: STA
	-> starting wifi station mode
	-> connecting to wifi host...
	-> ssid: New_Frontiers 
	-> ipv4: 10.15.61.142
	*** OK ***

	~~~~~~~~~~~~~~~~~
	  INTERNET TIME  
	~~~~~~~~~~~~~~~~~
	-> setting sntp servers
	-> setting sntp server: pool.ntp.org 
	-> setting sntp server: ie.pool.ntp.org 
	-> setting sntp server: pool.ntp.org 
	-> getting time...
	It not was possible update date/time, server: pool.ntp.org is not working!

	datetime epoch format: 1571674679 
	date-time: 2019-10-21 16:17:59 
	check date-time on: https://www.epochconverter.com 
	*** OK ***

	~~~~~~~~~~~~~~~~~
	    DUMMY DATA   
	~~~~~~~~~~~~~~~~~
	-> setting a random number...
	-> random number: 14 
	-> generating json string

	json string: {
		"sensor_id":	"test-idf",
		"properties":	{
			"random_number":	14
		}
	} 

	~~~~~~~~~~~~~~~~~
	  POST TO CLOUD  
	~~~~~~~~~~~~~~~~~

	--- DEBUG SHIT ---
	<!DOCTYPE html><!--


	Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException: The GET method is not supported for this route. Supported methods: POST. in file /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php on line 256
	Stack tra
	--- DEBUG SHIT ---

	-> url: http://46.22.138.171/api/PostData 
	-> Sending data to cloud
	*** OK ***
	-> cleaning buffer for next data
	*** OK ***

	~~~~~~~~~~~~~~~~~
	TIME FOR DEEPSLEEP
	~~~~~~~~~~~~~~~~~

	datetime epoch format: 1571674732 
	date-time: 2019-10-21 16:18:52 
	check date-time on: https://www.epochconverter.com 
	*** OK ***

	-> actual time epoch format: 1571674732 
	-> time at night epoch format: 1571684400 
	-> difference time in (sec): 9668 
	2 hours - 41 minutes - 8 seconds 

	time is still at the morning, go to sleep for 4 hours 

	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
	STATE 1: END
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

	*** Entering deep sleep for 10 seconds ***
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

How to compile

idf.py build && idf.py -p /dev/ttyUSB0 -b 115200 flash monitor

hx711-esp-idf-library's People

Contributors

danieltobon43 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

hollymadcow

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.