Sunday 16 July 2017

E3276 and my fight to get it working


Issue


I wanted to upgrade my webcam system with a new dongle which supported 4G due to the carrier being upgraded and because 4G is everywhere now.
I bought a new dongle from Ebay which was pretty straight forward, just needed an unlocked one and I got it.
Following few tutorials, just because I couldnt remember exactly how to switch mode to CDC mode, I ended up to find the whole process difficult and unsuccessful.

Investigation


First, Huawei is an amazing dongle, second, routerunlock.com is an awesome website!
By Googling around, I found out that my dongle was fully working but running a wrong firmware which allows PPP mode but this is not what I needed.
Here is my discovery, Huawei modem have two communication:

  • Serial device
  • Composite or Ethernet device
As you can presume, what I wanted is Ethernet device.

Specifically on this model, the version 21 and before are SERIAL and 22 or above should be ETHERNET.
Using linux, I could trigger the mode by typing (remember 1506 needs to be discovered by doing lsusb):
usb_modeswitch -v 12d1 -p 1506 -J -R -W

Then your device will either go into Serial or Ethernet device.

If you are unfortunate like me that you can only access the model via serial, it is best to install a serial client which allows you to get IMEI number and firmware.

AT way


When you discovered that you device is using a Serial device, open it with a serial client ( I used arduino just because it was open at the moment),  and type:
ATI
You should see something similar:
Manufacturer: huawei
Model: E3276
Revision: 21.263.03.00.78
IMEI: 863**************
+GCAP: +CGSM,+DS,+ES
Remember to add CR at the end of every command!

Now you got some information, in my case I found out that I am running a firmware 21 and I got the IMEI to general the password.

You need to find out what exatcly model you got, by typing AT^FHVER which should return somthing similar:
^FHVER:"E3276s-150 21.263.03.00.78,CH1E3276SM Ver.C"

Now I got everything:

  • Running 21 firmware
  • I got my IMEI
  • I got the model which is E3276s-150

Password


You need to generate a password from your IMEI, there this website which ask to login with your G+ then ask for a G+ like and then you will get the password for free. Not a bad deal!

Firmware


Now that I have all the information I can go ahead and flash my device with the latest one from this website , you could possibly find another website but this worked for me.
Remember to flash first WEBUI then the FIRMWARE, otherwise you are going to run into issues like I had.

Remember to double check the model, mine was 150, yours could be different.

Once you have flashed the two file ( Firmware and WEBUI ), your device should be ready and your should be able to open the page http://192.168.1.1

What if you flash WEBUI as last

Without even thinking about it, I flash the firmware then the webui, unfortunately the webui software couldnt find the device and thrown me errors. The device itself was working and the API call did work.

The little trick is to be able to switch the mode by using the API or if you had a older version of WEBUI by going to http://192.168.1.1/html/switchProjectMode.html


Thankfully I found a just who made a curl script with the right parameters to switch and then I  successfully flashed my WEBUI

echo "<request><mode>1</mode></request>" | curl -X POST -H "__RequestVerificationToken:1099746139" -H "Content-type: text/xml" -d @- http://192.168.8.1/api/device/mode



Versions



Sunday 7 May 2017

Communicate between Raspberry Pi and Arduino

Intro:
I was looking how I could talk between Raspberry Pi and Arduino, because sometimes is much easier to get a sensor, driver motor or else ready in C instead of trying to code something that will take months to get it working.

http://amzn.to/2pQXDUw

Communications:
Raspberry Pi has the advantage to have SPI, I2C and Serial port communication, but for laziness I chose the Serial port. Of course you could try to go for SPI or I2C but it will take a little bit of more time to setup everything.

What you need:
You can use the serial port already existing on the Raspberry's pins but to make sure that I am not going to send some dirty data, because you can access the console via com, I chose to buy a usb ftdi.
You can buy the "official" usb to ttl, that will cost you around 15 pounds or you can go for a standard and cheap one here that works great!

Connection:
Connect the usb ttl on your Raspberry's usb port and then 3 cables in yours Arduino, remember to dont connect the power pin! It wont damage your Arduino but better dont risk.

 Black pin = > Arduino Ground
 Green pin => Arduino RX
 White pin => Arduino TX

You can choose other two pins for RX and TX but if you need to talk straight to the Arduino, just use the common serial port.


Code:
I did few lines of code in Python, or just use any other languages to read and send on serial port.
This is the simple code:



On your Arduino just write whatever to answer or decode from Raspberry Pi, this is a simple example:



Conclusion:
It's pretty simple and easy to communicate via Serial port, make sure that you always:

  • select right bitrate
  • remove the usb ttl when uploading a new Arduino project
  • try simple communication if there is any communication problems
  • never connect the red pin to the Arduino board
  

Saturday 15 October 2016

Huawei E3131 issues with 3G



I had some issues with my dongle due to a change of carrier and probably change of frequency.
My lovely dongle stopped working on 3G network and decided to connect only on 2G, which made my life a hell.

After few head scratches ( 4 hours ), I tried to upgrade the firmware, which was very hard to find due to the old hardware and only few people providing the software.

I found this russian website which has a good archive of firmware, just use google translate to read what the website say.

The procedure is easy:
1) Connect your dongle to a windows machine
2) Run the upgrade firmware software and it will make the device become a serial port
3) If you dont have the driver installed, you will need to download the Mobile Partner software which includes all drivers
4) If you run windows 10, make sure you reboot on "disable signature drivers" or you will never install them
5) You might need to edit the ini to allow the driver to be installed as not all of the devices are listed but the driver is generic
6) After all of this, run again the upgrade firmware software
7) At some point you will be asked to insert a password, go on here and use your IMEI to get your password
8) After all of this, the job is done! I got back my 3G connection.

Small tip, you will probably need to flash WebUI as well, on my case, it just didnt work and I had to flash it.


I hope this helped someone else.

Modem: http://amzn.to/2qeFi4T

Saturday 13 February 2016

Karcher SC3 Broken

A very interesting Saturday where I had this Karcher Steamer machine which turned on, detecting water level but not able to warm it up.

After a bit of thinking I have decided to open it and try to find the issue on this simple system, maybe a fuse? Maybe a broken part? It must had be very simple!

I had to follow each cable and understand how it worked:

The controller is powered up and checking if the water is present, if not a light turns on and the pump doesnt turn on.

When the water is present, a pressure detection of 2.1 Bar is taking care to turn on and off the heating element.

When then temperature goes low, the switch turns on the pump that allows the water to be pumped inside the heating system.


Luckily my issue was very simple, I have tested the pump and few connections but nothing was broken or burnt. What I didnt actually check is the long run cable where a female connector wasnt secure inside the pin which controlled the whole heating and pump system. 

Put all back together and I had my steamer machine working without buying a new one or contacting the support.




Product on amazon: http://amzn.to/2pR5n8R

Tuesday 3 November 2015

Talking Scary Pumpkin

Introduction

It is Halloween, or at least it was when I made this pumpkin,  and I had to make something scary otherwise.
The pumpkin needed to have sound, flashing lights and sensor to trigger when people were walking past, and everything powered with 9V.


Code is available here


Items

I ordered a simple MP3 serial player to connect to the Arduino, one small amplifier to pump the sound, two speakers, PIR sensor and a lot of leds.

MP3 Serial player
Amplifier
Speakers
PIR sensor


But remember, dont buy always cheap stuff otherwise you will end up to fine tune your installation without any clue, read more about below.



Why you need to spend that pound more
I tried to make the whole project as cheap as possible due to the pieces that I wasnt going to re-use anymore. But this came with a price to pay, having sensor which dont have any labels on the PCB and you have no clue what each pin do and how to tune it.


After few investigation and comparing the good PIR sensor to this cheap one, I find out what are the pins to connect and the two potentiometers.


From the picture above you can see no labels are on the board and I pointed each one pin where should be connected to get it working.

The potentiometers was a bit tricky as different boards on the internet were showing different functionality. 
This board has the first potentiometer which set the sensitivity of the sensor, turning to the left it will make less sensible and to the right more sensible.
The second is setting the timing but it is very sensible as the position on the picture would be 65 seconds of wait and twisted all the way to the left is 2 seconds, so I would assume that all the way to the right might be 260 seconds. 

I hope these information might help someone having the same issue as I had in this installation.
Wiring

You can see from the picture below that is a total mess! Sorry, I didnt have time to clean it up as it was a one day project and it needed to work the day after.



I have used some stick to help to position some leds in the eyes, position the PIR in the nose, place the speakers on the back, some leds inside to make a nice light reflection and the arduino.

The MP3 player was connected over Serial and then amplifier on the output and then to the speakers, make sure you use 5V, otherwise the module might reset and make a horrible noise.

I had 4 strip of leds which had 4 light on each one, I have connected them to 4 pwm pins to make sure I can play with flashing and fading.

I found an old case for the battery which will provide 9V to the arduino and the PIR sensor connected to one of the digital pins.


How it works
Probably you already understood what I have done if you read the lines above, but my idea was to scary people by walking pass to a glowing pumpkin and make them think that it was alive.

The Arduino has two modes, one that glow all the lights with a different timing, and one flashing and triggering the sound. The PIR sensor was the device that was triggering the different mode and some delay to make sure the pumpkin wouldnt go crazy.


Result














































A video posted by Christian Bianchini (@christian.bianchini) on




A video posted by Christian Bianchini (@christian.bianchini) on

Saturday 24 October 2015

MP3 Player Serial

Introduction
The mp3 player serial is a cheap solution to add sound to your project, otherwise you could get a shield from Sparkfun or Adafruit which would cost more.

Shop online
http://amzn.to/2pQWXOK

Files
I couldn't find much information about this device or the vendor didn't give me a datasheet or sample arduino, so after I google for a while, I found all of it.

Datasheet and Sample Arduino




Wiring



The wiring is pretty simple, connect the serial communication to the Arduino and 5V is required.
In my project I add a 3W amplifier just in case the sound wouldn't be too loud but otherwise you can avoid it.


Commands

The datasheet confirm that there are these commands available for this module:

  • Next song
  • Previous song
  • Play with index
  • Volume up
  • Volume down
  • Set volume
  • Single cycle play
  • Select device
  • Sleep mode
  • Wake up
  • Reset
  • Play
  • Pause
  • Play with folder and file name
  • Stop play
  • Cycle play with folder name
  • Set single cycle play
  • Set DAC
  • Play with volume

Tuesday 5 May 2015

3D Printed Chain Guard

Description
I changed my Crank of my bike recently and it didn't have a chain guard to protect my jeans to get smashed and dirty.
The options were to buy one online that means 10-12 GBP or to get a 3D model online and print it with my "already paid" filament.
I went on Google and found one model that looked good and big enough for main Crank but when I tried on my bike, it was too small.  What I have done is to measure the right diameter and increase the size to match my 12 cm disk.


Solution


I have shared the model, even if it is not the correct ratio, but people could improve it and print it.

https://www.tinkercad.com/things/hOXnZpOtUmW-chainguard-12-cm


Result

Final result with 4 M4 screws