Linux tip: How to reset device connected to USB port

Sometimes devices connected to USB ports need to be re-set. It’s not unusual GSM modems and WiFi dongles to freeze and the only way to bring them back to life is to remove and re-attach.

OLinuXino USB ports has power switches and current limiters which can be controller by Linux drivers.

After some experimenting we found that it’s not so easy actually to do it with the standard file system and shell.

A friend suggested to try this code. It worked very well, so here is how to use it. First you need to download and compile it, then to make it executable:

$ mkdir usbreset
$ cd usbreset
$ wget $ https://raw.githubusercontent.com/jkulesza/usbreset/master/usbreset.c
$ cc usbreset.c -o usbreset
$ chmod +x usbreset

Then you need to see where your USB device is. In our case I connected MOD-WIFI-R5370 WiFi USB dongle:

$ lsusb

you will see something like:

Bus 002 Device 039: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter

to reset this device use the command:

./usbreset /dev/bus/usb/002/039

The device USB port will be power off for a second then power on again.

All above is tested and work with official Olimex Linux images from images.olimex.com, but should work on other Linux distributions too.

It’s Friday again and time for our Guess What is this Quiz

Screenshot from 2019-04-19 17-39-37

We just finished the routing of this new board, so the question is Guess what is it?

Screenshot from 2019-04-19 17-39-51.png

It uses Quectel EG21-G module which works anywhere in the world covering all GSM standards and frequencies. It also has GNSS build-in.

Screenshot from 2019-04-19 17-40-08

It also can connect to any network 2G-3G-4G whichever is available (sorry no 5G yet 😉 ).

Once the prototypes are ready and check we are preparing Crowd Supply campaign for it! Hint Fits perfect to LoRa-GATEWAY and allow connection where no wires and optics like mountain hubs, remote areas etc.

You can post here or retweet/share/boost on Twitter/Facebook/Mastodon/Diaspora and in Monday we will let Random.org to decide who will win one of our new eduArdu educational board.

Have a nice weekend!

UODATE 22-04-2019: Random.org selected @netsigi as winner!

 

New Product in Stock: OLIMEXINO-NANO-GSM shield EURO 23 Quad band GSM/GPRS + Bluetooth/FM radio

Image

OLIMEXINO-NANO-GSM shield is compatible with OLIMEXINO-NANO and adds Quad core GSM/GPRS capability. With this shield you can send and receive SMS, place and take phone calls, connect to http or ftp via GPRS.

In addition to GSM/GPRS module SIM800H also have Bluetooth 3.0+EDR and FM radio, which are also included as capability of this module. The GSM antenna is external for better range and reception, the Bluetooth antenna is printed on the PCB.

This module can be used with any of our other UEXT boards via jumper wires.

OLIMEXINO-NANO-GSM cost EUR 23 in single quantity.

Arduino library and demo code working with OLIMEXINO-NANO is provided.

OLIMEXINO-NANO-GSM shield prototypes works fine

ImageImage

OLIMEXINO-NANO is small 30×30 mm Arduino Leonardo compatible board with microSD-card, UEXT, micro USB and stack-able shields, the available shields for the moment are:

OLIMEXINO-NANO-GSM is new 4 band GSM shield + Classic Bluetooth combo board. It stacks on OLIMEXINO-NANO and add GSM/GPRS capability to it + Classic Bluetooth connectivity.

The shield will be in stock end of the month and will cost EUR 20

New Product in stock: OLIMEXINO-NANO wearable Arduino Leonardo clone

Image

In October I blogged for our new Arduino clone: The NANO with size only 30x30x8 mm.

Well we have them all three in stock now!

OLIMEXINO-NANO is the core module with USB micro connector, the stackable connectors for shields and UEXT to connect our many UEXT modules like BMP085, MPU6050, HMC5883L, Zigbee, temperature, magnetometers etc. etc.

OLIMEXINO-BB is stackable shield which allow you to connect NANO to Breadboard-1

OLIMEXINO-BAT is shield which contain Lithium 3V battery, connector for LiPo battery and on board charger.

The power supply for NANO is made very intelligently and as soon you connect LiPo it will take power from there, if the USB is connected the batteries are disconnected and start charging them.

We have two more modules which will be ready in few weeks:

  • EUR 10 Bluetooth 4.0 BLE shield which will allow the wearable NANO to be connected to iPhones without licensee issues or to Android phones with Bluetooth 4.0 and will allow interactions with phones and tablets with different sensors connected to NANO
  • EUR 22 GSM/GPRS 4 band shield with external antenna which will add connectivity via GSM

The NANO shield concept is that the connectors are SMT type and stackable, on bottom there is male connector, on top is female connector so you can stack as many shield as you want together.

Friday Free Board Quiz Issue #21 prize is PIC-GSM

Image

Christmas is approaching and our prizes become bigger and bigger 🙂

With PIC-GSM you can control 2 relays via cellular GSM phone or over Ethernet, you have optoisolated inputs, microphone, tos of GPIOs and backup battery.

So implementing on your GSM house monitoring or controlling your home heating system or solar panel via GSM or Ethernet is possible to be implemented with this board.

Today at 17.00 o’clock our local Bulgarian time (GMT+2) we will post on Twitter our question.

You have one hour to reply to our tweet with the correct answer.

At 18.00 o’clock we will count the correct answers and ask random.org to generate random number in range then anнounce the winner and ship the board by airmail next Monday.

Good luck!

STELLARIS-UEXT adapter for Stellaris launch pad in stock

Image

STELLARIS-UEXT is Texas Instruments Stellaris Launchpad to UEXT adapter.

We have prepared demo code for MOD-GSM, MOD-MP3, MOD-GPS, MOD-TC, MOD-SMB380, MOD-IRDA, MOD-LCD3310 so you can interface these modules from your Stellaris Launchpad.

As Stellaris MCU have two SPI, I2C and UARTs we made the adapter with two separate UEXT connectors so you can connect two independant UEXT modules to it. Each UEXT have power up/down control with MOSFET so you can power up and down UEXT modules connected.

Using MOD-GSM with iMX233-OLinuXino

Image

MOD-GSM is 4 band cellular phone GSM/GPRS module which allow any board with UEXT connector to place and take GSM calls and to send and receive SMS-s and to connect to internet through GPRS and send and receive TCP-IP data.

Onw of our developers, Stefan made small demo example for how to use MOD-GSM with iMX233-OLinuXino, the project is at GitHub https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/iMX233/MOD-GSM

you can compile it with:

$ cc MOD-GSM.c -o mod-gsm

them make it executable with

$ chmod +x mod-gsm

and use it with

$ ./mod-gsm -help

what MOD-GSM code does? Each time somebody call the SIM card phone number it will log it in CALL-LOG file, if SMS is received it’s logged in SMS-LOG

with:

$ ./mod-gsm -pb ADD OLIMEX +35932626259

you create new entry in the PHONE-BOOK

then if you got call from +35932626259 it will log it as call from OLIMEX

you can send SMS with this command

$ ./mod-gsm -sms OLIMEX

then the program will wait for the SMS text terminated with <enter> and send it

you can also run mod-gsm with & to run in background and log your calls and SMS-s

Important note: SIM card which you insert in MOD-GSM should have no PIN code, also UEXT cable should be at least 20 cm as when MOD-GSM is near OLinuXino during the call time it emits so much energy that from time to time cause re-boot, to prevent this as you can see on the picture above I add some aluminum shield between the MOD-GSM and OLinuXino.

Also it’s good to cut the ribbon cable and left only wires# 1-4 which carry VCC, GND, UART.TX and UART.RX as MOD-GSM depend on how configured my drive up/down the other UEXT ports also and to mess with other modules on the UEXT bus.

PIC32-PINGUINO NEW DEMO EXAMPLES UPLOADED

Image

PIC32-PINGUINO is Arduino like board which works with Pinguino IDE.

Several new demo examples are uploaded on our web https://www.olimex.com/dev/pic32-pinguino-otg.html

1. MOD-GPS demo example with our GPS module

2. MOD-CC2450 demo example with our low energy Bluetooth module (still not released on our web 🙂 )

3. SHIELD-EKG-EMG demo example how to interface this shield to Pinguino and measure pulse and muscle activity

4. MOD-MP3-X demo example how to play MP3 files with Pinguino

5. Sending and receiving calls and SMS with MOD-GSM and Pinguino

6. Connecting to Bluetooth enabled devices with MOD-BT and Pinguino

7. Interfacing MOD-ZIGBEE-PIR with Pinguino

8. MOD-RTC real time clock interfacing with Pinguino

9. Reading 13.56Mhz RFID tags with Pinguino and MOD-RFID1365-BOX

all examples have readme.txt inside which explains the functionality

CONTROL PINGUINO REMOTELY VIA GSM

ImageImage

New demo example is uploaded on PIC32-PINGUINO-MX220 web page which demonstrate how to add GSM remote control to Pinguino and place and receive GSM calls.

PIC32-PINGUINO-MX220 have UEXT connector which allow MOD-GSM to be connected and easy to add cellular remote control.

The demo code contain PDE sketch which take calls and if the call is from GSM phone which is known toggle the on board LEDs (or if you attach relay can open your garage door for instance). If the on board button is pressed Pinguino will call stored phone number (i.e. panic button, or alarm event).

The demo code is at http://www.olimex.com/dev/DUINO/PIC32-PINGUINO-MX220/PIC32MX220_MODGSM_call_example.zip

Previous Older Entries