App to Launcher

Moderators: mdrjr, odroid

App to Launcher

Unread postby mameise » Sat Jul 07, 2018 7:16 am

Hi,

i am thinking of connecting a fona 3G modul to the Odroid-go to maybe make a call with it :) But goal would be to have some kind of phone app beside the emulators.
Would that be possible?

Thanks
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO

Re: App to Launcher

Unread postby mad_ady » Sat Jul 07, 2018 2:00 pm

I doubt it, but how would you connect it physically? And where do you get a microphone?
User avatar
mad_ady
 
Posts: 4427
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: App to Launcher

Unread postby mameise » Sat Jul 07, 2018 4:49 pm

Well there are different options i am thinking of:

Due to lag of pins available over the connector i think i cannot connect it like i initially wanted:

connect a second screen, keyboard matrix and fona to the esp32

So i am now thinking of just connecting the fona to the Odroid. The fona only needs a serial connection and 1 or 2 additional pins depending on what features i want
I would connect an additional speaker and microphone to the fona directly. Problem or downside is that i would have to always select numbers with dpad.

Another possibility would be to build basically a standalone phone with its own microprocessor on the back and really just connect serial to Odroid. This way i could access fona from Odroid, but the phone on the back would be also usable when Odroid is switched off. I already made the same with the PocketC.H.I.P. and it works :)
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO

Re: App to Launcher

Unread postby mad_ady » Sat Jul 07, 2018 5:36 pm

It seems I spoke too soon. I looked at the fona specs and it seems to mainly need uart to work (which the go can expose through gpio). So you could use the go as a screen/keypad/dialer. You could even draw an on-screen numeric keypad and use dpad to select. The probles seems to be the fona needs 5V and the go supplies 3.3.
Don't know how easy it would be to access the net through the fona. You may need to implement ppp over serial or an at modem on the esp.
User avatar
mad_ady
 
Posts: 4427
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: App to Launcher

Unread postby mameise » Sun Jul 08, 2018 12:37 am

fona needs only a battery connected to work. And it can operate with 3v3 also.
There is a nice Arduino library to talk to fona and all it needs is a command through uart to be able to call. The fona itself basically does the main part and esp32 would only trigger events.
I think it should work so i will give it a try and the we will see. :)
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO

Re: App to Launcher

Unread postby mameise » Thu Jul 12, 2018 6:40 am

So i successfully connected fona to the odroid so far and fona starts up. I connected RX from fona to pin4 and TX to pin5 and as far as i understand this means 15 and 4 in Arduino IDE. But how do i set up a serial connection through this pins now?
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO

Re: App to Launcher

Unread postby odroid » Thu Jul 12, 2018 8:11 am

We will check whether there is a UART feature or not in the 10pin header socket.
Which baud-rate do you need? 9600bps is okay?
User avatar
odroid
Site Admin
 
Posts: 28610
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: App to Launcher

Unread postby mameise » Thu Jul 12, 2018 12:55 pm

Ideal is 4800 but fona can be set to any afaik.

Thank you very much :)
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO

Re: App to Launcher

Unread postby mameise » Thu Jul 12, 2018 3:23 pm

I searched around a bit and i think it should be possible as the esp32 can route uart to nearly any pin.
Can't wait to see odroid doing a call :) This would finally turn into my daily cell phone as i always want to get rid of that mainstream crap...
I already built a phone with an atmel1284 chip and a small oLED screen and the classic T9 key layout. But it is a bit too boring without anything on it.
(writing an OS is much more complex than i thought :D Calls, basic settings and SMS already works)
Odroid-go is a really perfect gaming device and combined with a phone modul is at least much more interesting.
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO

Re: App to Launcher

Unread postby lsc1117 » Thu Jul 12, 2018 4:34 pm

Hi mameise,

ESP32 can only use three UARTs.
In the ODROID-GO, however, only UART0(F/W writing, system debugging) is available.
Because the other UART1 and UART2 are in use for PSRAM and Flash ROM.

I will test the 10 Pin expansion using a software serial library.
lsc1117
 
Posts: 84
Joined: Thu Aug 22, 2013 12:46 am
Location: South Korea
languages_spoken: english

Re: App to Launcher

Unread postby mameise » Thu Jul 12, 2018 5:01 pm

all are in use already :( sad to hear... But thanks for the information.

Regarding Software Serial i have red somewhere that ESP32 cannot handle Softwareserial as such. Maybe i understood it wrong (hopefully) :)
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO

Re: App to Launcher

Unread postby mameise » Thu Jul 12, 2018 5:14 pm

Found here an interesting approach:

https://hackaday.com/2017/08/17/secret-serial-port-for-arduinoesp32/

(If link not allowed please remove or inform me)

Would that maybe help?

Edit:

Here it seems someone got SoftwareSerial working with a special library:

https://www.reddit.com/r/hackerboxes/comments/5xba6g/softwareserial_working_for_esp32arduino_ide/

Seems will be a busy evening today :)
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO

Re: App to Launcher

Unread postby mad_ady » Thu Jul 12, 2018 7:18 pm

@mameise - how will you handle receiving a call/sms while gaming/in an emulator? Or will you be offline then? Also, what happens when the go is turned off? I'm sure your project will make an interesting read for odroid magazine when done.
User avatar
mad_ady
 
Posts: 4427
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: App to Launcher

Unread postby mameise » Thu Jul 12, 2018 8:00 pm

Most important is to get it working :)
After i know it is working i will create some kind of cover for the Odroid-go to be able to easily attach or remove it beside having the device still handy.

After that i will play around with the code and how to implement a good way.
The fona rings even without any microcontroller attached already. So i would at least get a hint about incomming call.
One way would be to simply exit emulator and switch to phone app to answer the call. Another solution could be to connect a seperate „answer“ button because fona supports taking a call directly. But i agree, could be some downsides are popping up but anyway there is always a solution :)

When the go is turned off there are also different approaches as fona will have its own battery. I thought of using the nice feature go provides: pressing menu for some secs to turn device off. Maybe there is a way to start the device back up when a call is comming in. As fona also has a ring indicator pin this should somehow be doable too.

But first: get a positive response through uart, that would open up my mind for possible solutions. As i already played around with the fona module a lot i just need to understand how the go is working. That will help me to find possible ways.

I will anyway try to document the project with pictures and steps i did to allow others to easily adopt. Biggest point i should mention: I am no pro at all... I had no education in electrics or coding or anything. But i love to play around and try until it works. So could be there are things i miss or do too complicated. That is why whenever someone has valuable input or hints for me i am more than happy :)
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO

Re: App to Launcher

Unread postby mameise » Fri Jul 13, 2018 1:02 am

I now tried it with this modified SoftwareSerial library for esp32:

https://github.com/jdollar/espsoftwareserial/

And this is the test sketch:

Code: Select all
#include <odroid_go.h>
#include <SoftwareSerial.h>

// On GPIO Connector fona RX is connected to pin4 and fona TX to pin5 - so this are the configs
#define FONA_RX 15
#define FONA_TX 4


SoftwareSerial fonaSerial(FONA_RX,FONA_TX);
 
void setup() {
  //start go
  GO.begin();
  //print a first test hello
  GO.lcd.println("Hello, ODROID-GO");
  //start fona serial connection
  fonaSerial.begin(4800);
  //second test screen output
  GO.lcd.println("Hello, ODROID-GO2");
  //  delay(1000);
  //first check if serial is available
  if (! fonaSerial.available()) {
    //GO.lcd.clearDisplay();
    GO.lcd.println("fona not found");
  }
}
 
void loop() {
  //check if we entered loop
  GO.lcd.println("started");
  //as soon as fona is available it should output on screen
  if (fonaSerial.available()) {
    GO.lcd.clearDisplay();
    GO.lcd.println("fona found");
  }
  //wait between reloop
  delay(5000);
}


But it does not work. I see the start every 5 seconds in the screen so the code runs into loop but the fona is not recognized. I have tested with default Baudrate 115200 and then have set to 4800 with an Arduino uno and never got response from fona.
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO

Re: App to Launcher

Unread postby mameise » Fri Jul 13, 2018 4:05 am

https://hackaday.com/2017/08/17/secret- ... uinoesp32/

This seems to not work as whatever i set i always get an error during compiling about first defined and already used and things. I think because all are already set by the firmware of go.
So only way will be SoftwareSerial. Adafruit library for fona3g also did not work.
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO

Re: App to Launcher

Unread postby odroid » Fri Jul 13, 2018 8:42 am

Can you toggle IO15/IO4(Pin4/Pin5) via normal GPIO access?
User avatar
odroid
Site Admin
 
Posts: 28610
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: App to Launcher

Unread postby Vacnatz » Fri Jul 13, 2018 10:04 am

Heya, so you sure the pins you're using support change interrupts?

SoftwareSerial is depreciated at this point for main line arduino boards and it's interface is pretty bare bones, it only supports specific pins on specific microcontrollers.
Interruptable pins stop the arduinos loop and trigger actions whenever a specific actions is taken, i.e. a packet of data is recieved.

This is important in this case because i imagine there's a handshake that occurs between the fona and the fona library on the microcontroller when an interrupt is triggered.

altsoftserial is a more fully featured library and may give you the type of connection you're looking for as it supports interrupts, though depending on the other peripherals in the odroid it may not work
https://www.pjrc.com/teensy/td_libs_AltSoftSerial.html

Another option for you would to be to connect it to something with a ton of hardware serial ports, like a teensy, and use it as a rather extravagant go-between ie:

1. Odroid sends a dial message to a teensy (or other microcontroller w/interrupts) via a simple serial message

2. The teensy takes the dial message and formats/sends to the fona

3. The teensy then sends a serial flag back to the odroid, updating the current status of the fona so it can be displayed

It adds another board, but it might solve your issue...

In any case make sure the pins you're using support interrupts in software serial, the unos mapping will not directly translate to the esp32 especially with the other peripherals in it.

the interrupt thing is pretty explicit on the arduino software serial documentation, I know you're using a esp32 port, but it's a port of a port made for another esp board so milage may vary.
https://www.arduino.cc/en/Reference/SoftwareSerial

Dont be afraid to mess around in the library code either, it's built with arduino as well, so if it's referencing specific pins, you may be able to change it.

i had a similar issue with LEDs and an ATWINC board and interrupts were the primary culprit.
Vacnatz
 
Posts: 15
Joined: Sun Jul 08, 2018 4:04 am
Location: Canada
languages_spoken: english, arduino,
ODROIDs: ODROID GO

Re: App to Launcher

Unread postby crashoverride » Fri Jul 13, 2018 10:10 am

Using esp-idf, it should be possible to route a UART to the expansion header. The flash and PSRAM occupy the SPI peripheral which is not shared by UART on ESP32 as it is on other micro controllers. There should be (3) SPI and (3) UARTS. Only one of the UARTs should be reserved for the serial debug console.

Example UART code can be found here:
https://github.com/espressif/esp-idf/tree/master/examples/peripherals/uart_echo

All that should be required is to change the pin numbers to those used on the expansion port:
https://github.com/espressif/esp-idf/blob/04caff2fb226b34dd6e8fa558e1f0e384afccad4/examples/peripherals/uart_echo/main/uart_echo_example_main.c#L26-L27
crashoverride
 
Posts: 3914
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: App to Launcher

Unread postby mameise » Fri Jul 13, 2018 2:58 pm

odroid wrote:Can you toggle IO15/IO4(Pin4/Pin5) via normal GPIO access?


Did not try to toggle this 2 pins but for the adafruit library there is a reset pin to be connected also. I have connected it with pin3 and i see the pin is triggered because fona restarts. So basic control over pins is there.
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO

Re: App to Launcher

Unread postby mameise » Fri Jul 13, 2018 3:02 pm

Thanks, will test around with altsoftserial today evening to see. Option for a second microcontroller i also mentioned above but as complete device with own display and stuff. But to use only a microcontroller could also be a solution. Good point.

Vacnatz wrote:Heya, so you sure the pins you're using support change interrupts?

SoftwareSerial is depreciated at this point for main line arduino boards and it's interface is pretty bare bones, it only supports specific pins on specific microcontrollers.
Interruptable pins stop the arduinos loop and trigger actions whenever a specific actions is taken, i.e. a packet of data is recieved.

This is important in this case because i imagine there's a handshake that occurs between the fona and the fona library on the microcontroller when an interrupt is triggered.

altsoftserial is a more fully featured library and may give you the type of connection you're looking for as it supports interrupts, though depending on the other peripherals in the odroid it may not work
https://www.pjrc.com/teensy/td_libs_AltSoftSerial.html

Another option for you would to be to connect it to something with a ton of hardware serial ports, like a teensy, and use it as a rather extravagant go-between ie:

1. Odroid sends a dial message to a teensy (or other microcontroller w/interrupts) via a simple serial message

2. The teensy takes the dial message and formats/sends to the fona

3. The teensy then sends a serial flag back to the odroid, updating the current status of the fona so it can be displayed

It adds another board, but it might solve your issue...

In any case make sure the pins you're using support interrupts in software serial, the unos mapping will not directly translate to the esp32 especially with the other peripherals in it.

the interrupt thing is pretty explicit on the arduino software serial documentation, I know you're using a esp32 port, but it's a port of a port made for another esp board so milage may vary.
https://www.arduino.cc/en/Reference/SoftwareSerial

Dont be afraid to mess around in the library code either, it's built with arduino as well, so if it's referencing specific pins, you may be able to change it.

i had a similar issue with LEDs and an ATWINC board and interrupts were the primary culprit.
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO

Re: App to Launcher

Unread postby mameise » Fri Jul 13, 2018 3:05 pm

crashoverride wrote:Using esp-idf, it should be possible to route a UART to the expansion header. The flash and PSRAM occupy the SPI peripheral which is not shared by UART on ESP32 as it is on other micro controllers. There should be (3) SPI and (3) UARTS. Only one of the UARTs should be reserved for the serial debug console.

Example UART code can be found here:
https://github.com/espressif/esp-idf/tree/master/examples/peripherals/uart_echo

All that should be required is to change the pin numbers to those used on the expansion port:
https://github.com/espressif/esp-idf/blob/04caff2fb226b34dd6e8fa558e1f0e384afccad4/examples/peripherals/uart_echo/main/uart_echo_example_main.c#L26-L27


This is interesting. So there are 2 free uart available when i understand you right. So this would mean it should really work with hardserial. I just need to figure out how :) that would be the prefered solution. I need to look into this this evening befor trying the altsoftserial. Thanks for the clarification of used connections in go.
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO

Re: App to Launcher

Unread postby lsc1117 » Fri Jul 13, 2018 5:41 pm

crashoverride wrote:Using esp-idf, it should be possible to route a UART to the expansion header. The flash and PSRAM occupy the SPI peripheral which is not shared by UART on ESP32 as it is on other micro controllers. There should be (3) SPI and (3) UARTS. Only one of the UARTs should be reserved for the serial debug console.

Example UART code can be found here:
https://github.com/espressif/esp-idf/tree/master/examples/peripherals/uart_echo

All that should be required is to change the pin numbers to those used on the expansion port:
https://github.com/espressif/esp-idf/blob/04caff2fb226b34dd6e8fa558e1f0e384afccad4/examples/peripherals/uart_echo/main/uart_echo_example_main.c#L26-L27


The uart echo(loop-back) test with esp-idf works fine.
I have tested with expansion GPIO4 and GPIO15 pin.

@mameise - You can also use the esp-idf framework in Arduino.
I attached the tested code below

Code: Select all
#include <stdio.h>
#include <driver/uart.h>

#define ECHO_TEST_TXD  (GPIO_NUM_15)
#define ECHO_TEST_RXD  (GPIO_NUM_4)
#define ECHO_TEST_RTS  (UART_PIN_NO_CHANGE)
#define ECHO_TEST_CTS  (UART_PIN_NO_CHANGE)

#define BUF_SIZE (1024)

uint8_t *data = (uint8_t *) malloc(BUF_SIZE);
   
void setup() {
  // put your setup code here, to run once:
    uart_config_t uart_config = {
        .baud_rate = 115200,
        .data_bits = UART_DATA_8_BITS,
        .parity    = UART_PARITY_DISABLE,
        .stop_bits = UART_STOP_BITS_1,
        .flow_ctrl = UART_HW_FLOWCTRL_DISABLE
    };
    uart_param_config(UART_NUM_1, &uart_config);
    uart_set_pin(UART_NUM_1, ECHO_TEST_TXD, ECHO_TEST_RXD, ECHO_TEST_RTS, ECHO_TEST_CTS);
    uart_driver_install(UART_NUM_1, BUF_SIZE * 2, 0, 0, NULL, 0);

}


void loop() {
    // put your main code here, to run repeatedly:
    int len = uart_read_bytes(UART_NUM_1, data, BUF_SIZE, 20 / portTICK_RATE_MS);
    // Write data back to the UART
    uart_write_bytes(UART_NUM_1, (const char *) data, len);
}
lsc1117
 
Posts: 84
Joined: Thu Aug 22, 2013 12:46 am
Location: South Korea
languages_spoken: english

Re: App to Launcher

Unread postby lsc1117 » Fri Jul 13, 2018 6:51 pm

I have tested the all of expansion 10pin with UART.
https://wiki.odroid.com/odroid_go/odroid_go#odroid-go_header_p2_description

The available RX and TX pins are shown below.

RX - GPIO15, GPIO4, GPIO19
TX - GPIO18, GPIO12, GPIO15, GPIO4, GPIO19, GPIO23

In ODROID-GO, the P2 Header Pin# 2, 3 and 8 are output only.
So these pins can use only TX.
lsc1117
 
Posts: 84
Joined: Thu Aug 22, 2013 12:46 am
Location: South Korea
languages_spoken: english

Re: App to Launcher

Unread postby Vacnatz » Sat Jul 14, 2018 1:48 am

From the Fona Library Sketch: https://github.com/adafruit/Adafruit_FONA/blob/master/Adafruit_FONA.cpp

#if defined(ESP8266)
// ESP8266 doesn't have the min and max functions natively available like
// AVR libc seems to provide. Include the STL algorithm library to get these.
// Unfortunately algorithm isn't available in AVR libc so this is ESP8266
// specific (and likely needed for ARM or other platforms, but they lack
// software serial and are currently incompatible with the FONA library).
#include <algorithm>
using namespace std;
#endif

It's for the ESP8266, but a quick search will reveal that the ESP32 lacks these functions as well, unless they're a part of the ODROID GO library

You might try including the STL algorithm library in Adafruit_Fona.cpp by force, removing the if defined/endif statement.

The library is a good guide, in particular check out the begin function, there's a bunch more going on than beginning serial. Also setting baud rate and serial mode.


Code: Select all
boolean Adafruit_FONA::begin(Stream &port) {
  mySerial = &port;

  pinMode(_rstpin, OUTPUT);
  digitalWrite(_rstpin, HIGH);
  delay(10);
  digitalWrite(_rstpin, LOW);
  delay(100);
  digitalWrite(_rstpin, HIGH);

  DEBUG_PRINTLN(F("Attempting to open comm with ATs"));
  // give 7 seconds to reboot
  int16_t timeout = 7000;

  while (timeout > 0) {
    while (mySerial->available()) mySerial->read();
    if (sendCheckReply(F("AT"), ok_reply))
      break;
    while (mySerial->available()) mySerial->read();
    if (sendCheckReply(F("AT"), F("AT")))
      break;
    delay(500);
    timeout-=500;
  }

  if (timeout <= 0) {
#ifdef ADAFRUIT_FONA_DEBUG
    DEBUG_PRINTLN(F("Timeout: No response to AT... last ditch attempt."));
#endif
    sendCheckReply(F("AT"), ok_reply);
    delay(100);
    sendCheckReply(F("AT"), ok_reply);
    delay(100);
    sendCheckReply(F("AT"), ok_reply);
    delay(100);
  }

  // turn off Echo!
  sendCheckReply(F("ATE0"), ok_reply);
  delay(100);

  if (! sendCheckReply(F("ATE0"), ok_reply)) {
    return false;
  }

  // turn on hangupitude
  sendCheckReply(F("AT+CVHU=0"), ok_reply);

  delay(100);
  flushInput();


  DEBUG_PRINT(F("\t---> ")); DEBUG_PRINTLN("ATI");

  mySerial->println("ATI");
  readline(500, true);

  DEBUG_PRINT (F("\t<--- ")); DEBUG_PRINTLN(replybuffer);



  if (prog_char_strstr(replybuffer, (prog_char *)F("SIM808 R14")) != 0) {
    _type = FONA808_V2;
  } else if (prog_char_strstr(replybuffer, (prog_char *)F("SIM808 R13")) != 0) {
    _type = FONA808_V1;
  } else if (prog_char_strstr(replybuffer, (prog_char *)F("SIM800 R13")) != 0) {
    _type = FONA800L;
  } else if (prog_char_strstr(replybuffer, (prog_char *)F("SIMCOM_SIM5320A")) != 0) {
    _type = FONA3G_A;
  } else if (prog_char_strstr(replybuffer, (prog_char *)F("SIMCOM_SIM5320E")) != 0) {
    _type = FONA3G_E;
  }

  if (_type == FONA800L) {
    // determine if L or H

  DEBUG_PRINT(F("\t---> ")); DEBUG_PRINTLN("AT+GMM");

    mySerial->println("AT+GMM");
    readline(500, true);

  DEBUG_PRINT (F("\t<--- ")); DEBUG_PRINTLN(replybuffer);


    if (prog_char_strstr(replybuffer, (prog_char *)F("SIM800H")) != 0) {
      _type = FONA800H;
    }
  }

#if defined(FONA_PREF_SMS_STORAGE)
    sendCheckReply(F("AT+CPMS=" FONA_PREF_SMS_STORAGE "," FONA_PREF_SMS_STORAGE "," FONA_PREF_SMS_STORAGE), ok_reply);
#endif

  return true;
}

/********* Serial port ********************************************/
boolean Adafruit_FONA::setBaudrate(uint16_t baud) {
  return sendCheckReply(F("AT+IPREX="), baud, ok_reply);
}



If i we're you I'd:
- Work through the FONA library example on a specifically supported board to confirm that the FONA works. This rules out a hardware problem on the FONA side.
- Take the working example code that you tested on the Uno and run it on the GO, make sure to set your softwareserial pins, and to include STL algorithms in the library .cpp as detailed before. Use softwareserial first, then try altsoftserial if it doesn't work.
- If all else fails, you have working code on another arduino that you can establish a serial connection with and it can do the heavy lifting with the FONA
Last edited by Vacnatz on Sat Jul 14, 2018 2:31 am, edited 4 times in total.
Vacnatz
 
Posts: 15
Joined: Sun Jul 08, 2018 4:04 am
Location: Canada
languages_spoken: english, arduino,
ODROIDs: ODROID GO

Re: App to Launcher

Unread postby lsc1117 » Sat Jul 14, 2018 2:28 am

123
lsc1117
 
Posts: 84
Joined: Thu Aug 22, 2013 12:46 am
Location: South Korea
languages_spoken: english

Re: App to Launcher

Unread postby lsc1117 » Sat Jul 14, 2018 2:29 am

12345
lsc1117
 
Posts: 84
Joined: Thu Aug 22, 2013 12:46 am
Location: South Korea
languages_spoken: english

Re: App to Launcher

Unread postby mameise » Sat Jul 14, 2018 2:30 am

Ok thanks for all the inputs. As i am, as i said, only a hobbyist doing this stuff i am not yet sure that i can handle it. But i will have to read all inputs completely and try to understand everything.

So as far as i got it while reading all input i would say it should basically be possible to make calls with the odroid-go - but if i am able to acchieve this goal i am not sure yet...

I will first look into hardware serial as crash mentioned not all uat ports are used. I think this would be the best solution.Even if i could not use the adafruit library would not be the biggest issue as i alteady know the calls needed to be sent to fona. I am not really sure how much i will be able to do today because i already had some beers now ( it is friday) but i will look into all input and see if i can get it working. Latest tomorrow.
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO

Re: App to Launcher

Unread postby Vacnatz » Sat Jul 14, 2018 2:37 am

https://learn.adafruit.com/adafruit-fona-mini-gsm-gprs-cellular-phone-module?view=all

Your example doesn't make any of the settings calls or handshakes needed to operate the board.

Your code calls it quits if it doesn't detect an active serial port, but the fona requires you to send it a command first in order for it to respond with a serial message.

Do the adafruit tutorial.

If the arduino code doesn't accomplish the basics of what is required to operate the board, then the pin assignments have nothing to do with your issues.
Vacnatz
 
Posts: 15
Joined: Sun Jul 08, 2018 4:04 am
Location: Canada
languages_spoken: english, arduino,
ODROIDs: ODROID GO

Re: App to Launcher

Unread postby mameise » Sat Jul 14, 2018 3:18 am

Vacnatz wrote:https://learn.adafruit.com/adafruit-fona-mini-gsm-gprs-cellular-phone-module?view=all

Your example doesn't make any of the settings calls or handshakes needed to operate the board.

Your code calls it quits if it doesn't detect an active serial port, but the fona requires you to send it a command first in order for it to respond with a serial message.

Do the adafruit tutorial.

If the arduino code doesn't accomplish the basics of what is required to operate the board, then the pin assignments have nothing to do with your issues.



Yes true my example was without ada library and just softserial. I will have to verify for sure but as far as i remeber the code basically works for fona with arduino. I would not be aware of a first call that would be needed to start fona. I have read the tutorial from adafruit a lot of times as i said i played around a lot with it. I also have it already working in a lot of different devices, some build from scratch with just an atmel chip. So might be i miss something and also i already wrote i am more a noob than a pro, but the code should be working i would say ;) But i will look into all responses in about an hour amd then we will see.

No offense at all, i appreciate any input, but your last comment reads to me: too stupid to talk to because he did not even get the basics... and there i just have to say: not true!
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO

Re: App to Launcher

Unread postby Vacnatz » Sat Jul 14, 2018 3:39 am

No offence intended, apologies if my message was glib.
Vacnatz
 
Posts: 15
Joined: Sun Jul 08, 2018 4:04 am
Location: Canada
languages_spoken: english, arduino,
ODROIDs: ODROID GO

Re: App to Launcher

Unread postby mameise » Sun Jul 15, 2018 4:21 am

Vacnatz wrote:No offence intended, apologies if my message was glib.


Sorry, was a bit drunk yesterday :S All green ;)
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO

Re: App to Launcher

Unread postby mameise » Sun Jul 15, 2018 4:28 am

lsc1117 wrote:
crashoverride wrote:Using esp-idf, it should be possible to route a UART to the expansion header. The flash and PSRAM occupy the SPI peripheral which is not shared by UART on ESP32 as it is on other micro controllers. There should be (3) SPI and (3) UARTS. Only one of the UARTs should be reserved for the serial debug console.

Example UART code can be found here:
https://github.com/espressif/esp-idf/tree/master/examples/peripherals/uart_echo

All that should be required is to change the pin numbers to those used on the expansion port:
https://github.com/espressif/esp-idf/blob/04caff2fb226b34dd6e8fa558e1f0e384afccad4/examples/peripherals/uart_echo/main/uart_echo_example_main.c#L26-L27


The uart echo(loop-back) test with esp-idf works fine.
I have tested with expansion GPIO4 and GPIO15 pin.

@mameise - You can also use the esp-idf framework in Arduino.
I attached the tested code below

Code: Select all
#include <stdio.h>
#include <driver/uart.h>

#define ECHO_TEST_TXD  (GPIO_NUM_15)
#define ECHO_TEST_RXD  (GPIO_NUM_4)
#define ECHO_TEST_RTS  (UART_PIN_NO_CHANGE)
#define ECHO_TEST_CTS  (UART_PIN_NO_CHANGE)

#define BUF_SIZE (1024)

uint8_t *data = (uint8_t *) malloc(BUF_SIZE);
   
void setup() {
  // put your setup code here, to run once:
    uart_config_t uart_config = {
        .baud_rate = 115200,
        .data_bits = UART_DATA_8_BITS,
        .parity    = UART_PARITY_DISABLE,
        .stop_bits = UART_STOP_BITS_1,
        .flow_ctrl = UART_HW_FLOWCTRL_DISABLE
    };
    uart_param_config(UART_NUM_1, &uart_config);
    uart_set_pin(UART_NUM_1, ECHO_TEST_TXD, ECHO_TEST_RXD, ECHO_TEST_RTS, ECHO_TEST_CTS);
    uart_driver_install(UART_NUM_1, BUF_SIZE * 2, 0, 0, NULL, 0);

}


void loop() {
    // put your main code here, to run repeatedly:
    int len = uart_read_bytes(UART_NUM_1, data, BUF_SIZE, 20 / portTICK_RATE_MS);
    // Write data back to the UART
    uart_write_bytes(UART_NUM_1, (const char *) data, len);
}


Your post did me point to what i needed. Thank you very much!

Had to use this:
uart_set_pin(UART_NUM_1, ECHO_TEST_TXD, ECHO_TEST_RXD, ECHO_TEST_RTS, ECHO_TEST_CTS);

And for HardwareSerial i had to use UART_NUM_1 and set the pins of course.

IT IS WORKING :) Successfull response from fona. I got IMEI already from it ;)

So next thing: Finish 3D work for a case to print an attachable cover for the odroid-go.

Thanks to all of you that helped getting it working. I will document everything and i hope i will not be the only one doing calls with his odroid-go :) :)
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO

Re: App to Launcher

Unread postby odroid » Mon Jul 16, 2018 9:39 am

Glad to hear you can start your own project. :D
Once you have a prototype DIY phone, please consider writing an article for our Magazine.
User avatar
odroid
Site Admin
 
Posts: 28610
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: App to Launcher

Unread postby 23pieces » Fri Aug 31, 2018 8:02 pm

Is there allready something like a Tutorial and Code? :D
23pieces
 
Posts: 8
Joined: Fri Aug 31, 2018 6:01 am
languages_spoken: english
ODROIDs: Odroid Go

Re: App to Launcher

Unread postby mameise » Fri Aug 31, 2018 10:45 pm

For the phone cover you mean?

I worked on the code a bit and already have a basic UI with T9 phone pad, some settings and things. Still need to do the sms part (read write) but did not work on it the last days. I am not sure if i should make a tutorial because i think noone will really build one... The fona itself cost twice the Odroid-go, so i thought only i am that crazy :) If you want to build one i can make a tutorial and release the code.
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO

Re: App to Launcher

Unread postby mad_ady » Fri Aug 31, 2018 10:50 pm

Even if others don't build the exact same thing they can get into similar problems (e.g. talking over serial, etc) and can benefit from your tutorial. Even if nobody uses your work it pays off (to you) to have it documented somewhere so that two years from now you can reproduce or extend what you built. That's my motivation for submitting articles to Odroid Magazine - to keep a documented record for myself (I'm my own biggest fan!) :D
User avatar
mad_ady
 
Posts: 4427
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: App to Launcher

Unread postby mameise » Sat Sep 08, 2018 12:29 am

True words :) Will update on weekend.
mameise
 
Posts: 79
Joined: Sat Jul 07, 2018 6:40 am
languages_spoken: english german
ODROIDs: ODROID-GO


Return to Arduino Coding Camp

Who is online

Users browsing this forum: No registered users and 1 guest