Search found 38 matches

by samerou
Wed May 08, 2019 2:22 pm
Forum: ESP8266 boards
Topic: ESP8266 /XAMPP-Converting arduino to Python
Replies: 7
Views: 4804

Re: ESP8266 /XAMPP-Converting arduino to Python

What happened, what error did you get when you tried to use http.client from micropython-lib That's not quite how the socket API works, see http://docs.micropython.org/en/latest/esp8266/tutorial/network_tcp.html for an example. This an error that is displayed :cry: , so Micropython like you said is...
by samerou
Wed May 08, 2019 1:45 pm
Forum: ESP8266 boards
Topic: ESP8266 /XAMPP-Converting arduino to Python
Replies: 7
Views: 4804

Re: ESP8266 /XAMPP-Converting arduino to Python

Very few libraries are included by default on MicroPython (in order to save space). Also not all Python libraries have MicroPython equivalents. There's a minimal http.client in micropython-lib, see github.com/micropython/micropython-lib it didn't work I tried to change even http.client with Socket ...
by samerou
Wed May 08, 2019 1:30 pm
Forum: ESP8266 boards
Topic: ESP8266 /XAMPP-Converting arduino to Python
Replies: 7
Views: 4804

Re: ESP8266 /XAMPP-Converting arduino to Python

Hi, Did you receive any error message? What did your print statement show? I notice the URL is "/info.php?request = sam", the spaces around the = are probably not what you want. Also, the HTTPConnection should be made to the host (and the port should be a separate argument), then request is for the...
by samerou
Wed May 08, 2019 11:43 am
Forum: ESP8266 boards
Topic: ESP8266 /XAMPP-Converting arduino to Python
Replies: 7
Views: 4804

ESP8266 /XAMPP-Converting arduino to Python

Hello , I'm working on a project that allows me to send specific data to a local Website (XAMPP server) but I tried this using arduino and it worked perfectly but when I tried to convert arduino into python i didn't succeed , Arduino Code : #include <ESP8266HTTPClient.h> #include <ESP8266WiFi.h> voi...
by samerou
Wed Apr 24, 2019 9:29 am
Forum: ESP8266 boards
Topic: Gyro/Mpu_Calibration "ESP8266"
Replies: 22
Views: 13505

Re: Gyro/Mpu_Calibration "ESP8266"

I don't believe the chip they are using is genuine. The purpose of line 105 is to check for a genuine MPU6050 device and it is failing. I'd comment it out and see if you get plausible results but there are no guarantees with Chinese clone chips. @pythoncoder , I appreciated your help , I will wait ...
by samerou
Wed Apr 24, 2019 8:38 am
Forum: ESP8266 boards
Topic: Gyro/Mpu_Calibration "ESP8266"
Replies: 22
Views: 13505

Re: Gyro/Mpu_Calibration "ESP8266"

@samerou The "bad chip ID" indicates that your chip is not a genuine InvenSense MPU-6050. This chip has been obsolete for a long time: even the MPU-9150 is obsolete with only the MPU-9250 currently manufactured. So I would question exactly what hardware you are using. This may be affecting your oth...
by samerou
Wed Apr 24, 2019 7:11 am
Forum: ESP8266 boards
Topic: Gyro/Mpu_Calibration "ESP8266"
Replies: 22
Views: 13505

Re: Gyro/Mpu_Calibration "ESP8266"

The statement: self.iic.writeto(self.addr, bytearray([107, 0])) is required to initialize the device, so please do not skip it. Thank you Roberthh as a result I get this {'GyZ': 103.6, 'GyY': 129.3, 'GyX': -90.9, 'Tmp': 42.5949, 'AcZ': -3004.8, 'AcY': -41.2, 'AcX': 16510.4} {'GyZ': 102.2, 'GyY': 12...
by samerou
Tue Apr 23, 2019 8:21 pm
Forum: ESP8266 boards
Topic: Gyro/Mpu_Calibration "ESP8266"
Replies: 22
Views: 13505

Re: Gyro/Mpu_Calibration "ESP8266"

@samerou If you're using an MPU6050 you don't need the mpu9150 or mpu9250 modules. You need imu.py and vector3d.py only. MPU6050 is the base class for the more complex sensors, and is implemented in imu.py . You should be able to issue: import machine from imu import MPU6050 i2c = machine.I2C(args_...
by samerou
Mon Apr 22, 2019 4:39 pm
Forum: ESP8266 boards
Topic: Gyro/Mpu_Calibration "ESP8266"
Replies: 22
Views: 13505

Re: Gyro/Mpu_Calibration "ESP8266"

@Roberthh , it workedd thank you and the values aren't weird but it need to get more stable
by samerou
Mon Apr 22, 2019 4:15 pm
Forum: ESP8266 boards
Topic: Gyro/Mpu_Calibration "ESP8266"
Replies: 22
Views: 13505

Re: Gyro/Mpu_Calibration "ESP8266"

I updated the code. in one of my posts above. But here it is again: import machine class accel(): def __init__(self, i2c, addr=0x68): self.iic = i2c self.addr = addr self.iic.writeto(self.addr, bytearray([107, 0])) def get_raw_values(self): a = self.iic.readfrom_mem(self.addr, 0x3B, 14) return a de...