Giter VIP home page Giter VIP logo

ambpro2_arduino's Introduction

Welcome to Ameba IoT site on GitHub

Realtek Ameba IoT supports a large variety of open-source projects, including SDKs, HDKs, solutions, components, and tools. Also, third parties contributions are included. This Ameba IoT eco system aims to help developers to study tranding technology and turn their innovation ideas into real. All Ameba IoT official opensource software are available on this GitHub site. The following link leads to all Ameba IoT open-source projects. Repository link.

Solutions

Frameworks and SDKs

Standard SDK Development

Arduino SDK Development

MicroPython SDK Development

Forum

Documents

Social Media

🏠 To learn about all products and services from Realtek Ameba IoT, please visit our official website Ameba IoT Homepage.

ambpro2_arduino's People

Contributors

ambiot avatar aurical avatar cold63 avatar daphwl avatar kyderio avatar m-ichae-l avatar michellethemaker avatar pammyleong avatar s10143806h avatar salmanfarisvp avatar siang-wen avatar xidameng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ambpro2_arduino's Issues

AudioNN + ObjDet

example code: AudioObjectDetection.ino

Compiled : OK
Problem : it still runs as an Object Detection, code size is same as object detection, audio classification is not included.
Questions:

  1. how can I fix my code to bring in Audio Classification ?
  2. how do I retrain audioNN to be a smaller one ? can I just have a few audio item to be recognized ?
    (hello, talking, yelling, slapping, snapping finger)

Can I reduce the time it takes to initiate the camera?

I'm working on an application that requires that the device wakes up and takes a picture extremely quickly. So far I've been able to get this down to 267ms which meets spec for the project. But to do this I had to initialize the file system AFTER I initialized the camera. I need to be able to apply settings to the camera that are stored on the SD card. However reading the SD card takes an additional ~250ms which pushes the overall time to picture up to nearly 600ms which is a little longer than I want. I want to see if I can shave off a few more milliseconds.

One of the things I would like to look at is the camera boot process. Right now it shows this:

VOE]ext_in = 0 sync = 0
[VOE]md init success
[VOE]algo ver ea63d5a 
[VOE]pack_v 0x0000 0x0002 cus_v 0 iq_id 0 dn 0 day 0 night 1 other 2 offset 224 length 16436 iq_size 32716 
[VOE]Ver 0x0001000c Fast3A Cnt AE 1 AWB 1 period AE 5 AWB 1 delay 0 0 
[VOE][isp_mod_sensor_init][1581]Errhdr_mode 0 is over sensor driver num 1 
[VOE]hdr_mode 0 sensor driver num 1 
[VOE]fps: 1880018620, pclk: 0, hts: 1077805056
[VOE]fps max 30.000000 min 5.000000 
[VOE]exposure_step 29.629629
[VOE]change sensor mode => [email protected] - 'linear' 
[VOE]min_fps 5.000000, max_fps 30.000000, exp_step 29.629629
[VOE]md ver 0x6d640100 
[VOE]ae ver 0x61650200 
[VOE]awb ver 0x77620100 
[VOE]cur_hdr_mode = 0
[VOE]VOE MEM Size = 11447 Used=  3550 KB Free= 7897 KB (8086944)
[VOE]stream 0  buffer 0: 0x7054ac00 size 460800 
[VOE]stream 0  buffer 1: 0x705bb500 size 460800 
[VOE]first_config_osd2_block_num[0]: 1
[VOE]osd2_block_num[0]: 24
[VOE]NV12 640x480 1/30
[VOE]dynamic set fps 0 -> 30 ok
[VOE]sensor power on
[VOE]zoom crop default setting
[VOE]status == 1718
[VOE]buffer size == (0x7063bbc0) (115200 38400) queue(20)

I want to get into the code that generates this output to see what I can tighten up. However I can't seem to find the .c/.cpp files generating this output. I'm seeing header files (.h) but no matching .c or .cpp files. I am also seeing a lot of .a files which makes me suspect that some of the files are precompiled binaries and not source code. Are the source files used to compile those binaries available? Is there a way I could have access to them? Or am I just looking in the wrong place?

Also do you have an environment for this camera that is outside of the Arduino library? The ESP32 had the C-level ESP-IDF. This product is advertised as having RTOS capabilities so is there a C-level library that can be used for development?

Thanks,

Jonathan L Clark

use i2c scanner issue..

// i2c_scanner
//
// Version 1
//    This program (or code that looks like it)
//    can be found in many places.
//    For example on the Arduino.cc forum.
//    The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
//     Adapted to be as simple as possible by Arduino.cc user Krodal
// Version 3, Feb 26  2013
//    V3 by louarnold
// Version 4, March 3, 2013, Using Arduino 1.0.3
//    by Arduino.cc user Krodal.
//    Changes by louarnold removed.
//    Scanning addresses changed from 0...127 to 1...119,
//    according to the i2c scanner by Nick Gammon
//    https://www.gammon.com.au/forum/?id=10896
// Version 5, March 28, 2013
//    As version 4, but address scans now to 127.
//    A sensor seems to use address 120.
// Version 6, November 27, 2015.
//    Added waiting for the Leonardo serial communication.
// 
//
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
//

#include <Wire.h>


void setup()
{
  Wire.begin();

  Serial.begin(115200);
  while (!Serial);             // Leonardo: wait for serial monitor
  Serial.println("\nI2C Scanner");
}


void loop()
{
  byte error, address;
  int nDevices;

  Serial.println("Scanning...");

  nDevices = 0;
  for(address = 1; address < 127; address++ ) 
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address<16) 
        Serial.print("0");
      Serial.print(address,HEX);
      Serial.println("  !");

      nDevices++;
    }
    else if (error==4) 
    {
      Serial.print("Unknown error at address 0x");
      if (address<16) 
        Serial.print("0");
      Serial.println(address,HEX);
    }    
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");

  delay(5000);           // wait 5 seconds for next scan
}

I used Arduino IDE 2.2 to run a simple i2c scanner code, but I didn't get the correct response. Can you check the result of this code execution?

AMB82 MINI RTSPFaceRecognition

麻煩新增加功能
能於 Arduino 程式裡可以移除某一已不需要偵測的人臉
而非 RESET 清除所有的人臉 再將需要的臉加入REG
以節省 Flash memory 能更多紀錄人臉
還有 能於某一 AMB82 MINI 偵測到的人臉 能夠有方法將 特徵值 Copy 到另一 AMB82 MINI
公司內會有需要多個 AMB82 MINI 但如果每個都重新記錄會花很多時間

AMB82-MINI compilation error.

截圖 2023-01-02 下午8 53 03
Using the RTSP stream in the example...(StreamRTSPSingleVideoWithAudio)
macOS
Arduino 1.8.19
AmebaPro2 4.0.1-build20221222

Error in compiling RTSPImageClassification.ino

Boards

AMB82-mini

External Hardware

None

Hardware Configuration

None

Version

latest dev (checkout manually)

IDE Name

Arduino IDE 2.3.2

Operating System

Ubuntu 22.04.3 LTS

Auto Flash Mode

Disable

Erase All Flash Memory (16MB)

Disable

Standard Lib

Arduino_STD_PRINTF

Upload Speed

2000000

Description

Error in compiling RTSPImageClassification

Sketch

examples/AmebaNN/RTSPImageClassification

Error/Debug Message

/tmp/.arduinoIDE-unsaved2024124-30881-9uix6n.un7gl/RTSPImageClassification/RTSPImageClassification.ino:91:26: error: 'IMAGE_CLASSIFICATION' was not declared in this scope; did you mean 'AUDIO_CLASSIFICATION'?
   91 |     imgclass.modelSelect(IMAGE_CLASSIFICATION, NA_MODEL, NA_MODEL, NA_MODEL, NA_MODEL, DEFAULT_IMGCLASS);
      |                          ^~~~~~~~~~~~~~~~~~~~
      |                          AUDIO_CLASSIFICATION
/tmp/.arduinoIDE-unsaved2024124-30881-9uix6n.un7gl/RTSPImageClassification/RTSPImageClassification.ino:91:88: error: 'DEFAULT_IMGCLASS' was not declared in this scope
   91 |     imgclass.modelSelect(IMAGE_CLASSIFICATION, NA_MODEL, NA_MODEL, NA_MODEL, NA_MODEL, DEFAULT_IMGCLASS);

Reproduce remarks

No response

I have checked online documentation, FAQ, GitHub Wiki and existing/closed issues.

  • I confirm I have checked online documentation, FAQ, GitHub Wiki and existing/closed issues.

Yolov4 Pothole Detection : Darknet cmake fail

example: yolov4-pothole-detection (using Darknet)

cmake failed

[ 97%] Linking CUDA device code CMakeFiles/dark.dir/cmake_device_link.o
[ 98%] Linking CXX shared library libdarknet.so
/usr/bin/ld: cannot find -lcuda: No such file or directory
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/dark.dir/build.make:1684: libdarknet.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:89: CMakeFiles/dark.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
[ 98%] Linking CXX executable darknet
/usr/bin/ld: cannot find -lcuda: No such file or directory
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/darknet.dir/build.make:1446: darknet] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:141: CMakeFiles/darknet.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2

Inquiry about changing wifi udp video streaming buffer

I am streaming video in real time using Wi-Fi UDP.
There is a phenomenon in which the video stops while the log below continues to be displayed.
Please let me know if I can fix the udp buffer or what exactly this log means.

[Driver]: skb_unavailable=15 in last 2 seconds

Playing MP3 file from file system on speaker

Hardware Environment

AMB82-mini

Related technical area

Libraries

Is the feature request related to an un-fixed issue?

No

Describe the ideal solution/reault/output.

My team wants to play stored MP3 files using the speaker connected to the A out pins. The current multimedia libraries do not support streaming an MP4 which has already ben recorded and stored in the SD card. Alternatively, if possible, we could also use the RTP library to join an RTP broadcast happening in a remote server to play the MP3 file.

Additional remarks

No response

I have checked existing/closed list of issues and the Contributing Guide.

  • I confirm I have checked existing/closed list of issues and the Contributing Guide.

I2C Err when running MPU6050_DMP_Teapot.ino

sample code:

[I2C Err]terminate tx op. after error

[I2C Err]residual len: 1

[I2C Err]last dat: 68

[I2C Err]tx abrt src:00000001

[I2C Err]terminate tx op. after error

[I2C Err]residual len: 2

[I2C Err]last dat: 68

[I2C Err]tx abrt src:00000001

[I2C Err]terminate tx op. after error

[I2C Err]residual len: 1

[I2C Err]last dat: 68

[I2C Err]tx abrt src:00000001

[I2C Err]terminate tx op. after error

[I2C Err]residual len: 1

[I2C Err]last dat: 68

D
[I2C Err]tx abrt src:00000001

[I2C Err]terminate tx op. after error

[I2C Err]residual len: 3

[I2C Err]last dat: 68

MP Initialization failed (code 1)
Sample Rate: 100

如何在AMB82-Mini 實現套用你的客製化模型?不確定怎麼上傳檔案才可以獲得官方郵寄的nb檔?

我們都知道amb82-mini 可以使用yolo-v7-tiny
官網也提供 如何套用你的客製化模型 的網址
但是裡面網址詳細說了需要以下資料
{
上傳包含cfg文件和權重文件的zip文件(必填,請上傳包含“.cfg”和“.weights”文件的文件夾或壓縮文件,均為英文命名,限制:35MB)
}
但是我訓練好的yolo v7 tiny 的
{weight資料夾 含有best.pt檔}
{cfg資料夾 含有yolov7-tiny.yaml檔}

請問我該怎麼做 怎麼上傳 才可以確保資料都對?可以順利上傳到官網 獲得nb檔呢?

Feature request - Crop image with face coordinates

Hi,

I would like to ask to create a new feature in arduino SDK. I’m using AMB82 MINI and I need to crop the image with the face coordinates to send to my cloud endpoint. I want to send only the face photo, instead of sending the entire photo to reduce internet bandwidth.

Adafruit GFX Library for SSD1306-OLED compiled error

SSD1306_OLED.ino
The I2C-OLED running OK with RTL8720DN(BW16), but failed on AMB82-mini.

In file included from d:\Users\rkuo2\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:13,
from D:\Users\rkuo2\Documents\Arduino\examples\Peripherals\SSD1306_OLED\SSD1306_OLED.ino:4:
d:\Users\rkuo2\Documents\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:93:41: error: 'SPI_MODE0' was not declared in this scope; did you mean 'SWD_MODE'?
93 | uint8_t dataMode = SPI_MODE0, SPIClass *theSPI = &SPI);
| ^~~~~~~~~
| SWD_MODE
d:\Users\rkuo2\Documents\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:102:41: error: 'SPI_MODE0' was not declared in this scope; did you mean 'SWD_MODE'?
102 | uint8_t dataMode = SPI_MODE0);
| ^~~~~~~~~
| SWD_MODE

exit status 1

Compilation error: exit status 1

RTL8735BM programming not working with uartfwburn.linux, ping failure

When I try to program an image to my device using

./uartfwburn.linux -p /dev/ttyUSB0 -f flash_ntz.nn.bin -b 115200 -U

I get errors like ping failure, as uartfwburn.linux is unable to confirm the device is present. I'm using just RX and TX without any hardware flow control. I know the device is in BootFromUART mode, here is the uart log:

== Rtl8735b IoT Platform ==
Chip VID: 0, Ver: 0
ROM Version: v3.0

[Normal mode]
BootFromNORFlash
[SPIF Err]Invalid ID
[SPIF Err]Invalid ID
[BOOT Err]Flash init error (io_mod=0, pin_sel=0)
Fallback to NAND Flash
Boot from NAND Flash
[BOOT Err]snafc init error
Fallback NOR Flash
BootFromNORFlash
[SPIF Err]Invalid ID
[SPIF Err]Invalid ID
[BOOT Err]Flash init error (io_mod=0, pin_sel=0)
Fallback to NAND Flash
Boot from NAND Flash
[BOOT Err]snafc init error
Fallback NOR Flash
BootFromNORFlash
[SPIF Err]Invalid ID
[SPIF Err]Invalid ID
[BOOT Err]Flash init error (io_mod=0, pin_sel=0)
Fallback to NAND Flash
Boot from NAND Flash
[BOOT Err]snafc init error
Fallback NOR Flash
BootFromUART
Image Load over UART1 baud=115200

Since uartfwburn.linux is closed source I have no idea how to proceed. Is there any documentation on the protocol the RTL8735 uses during the uart boot process?

Thanks anyone for any help!
-Dave

Palm Print Identification

I would like to use AMB82-MINI to do Palm Print Identification,

  1. need to detect palm, and crop the palm
  2. need more image processing to get finger-print (filtering, crop the palm, convert the size)
  3. using Palm Print model to train, then predict
    Any suggestion of developing this Palm Print Identification !!!

Wifi manager to store wifi credentials

Is there any sort or WiFi credentials management API? It would be great to be able to enter the wifi user name, password and ssid via the app and then be able store it in flash. Any information would be useful. Thank you.

attachInterrupt for GY953

GY953 is 9-axis IMU sensor using SPI and TX/RX signals to interface
example/basic.ino failed to compile at setting attachInterrupt

d:\Users\rkuo2\Documents\Arduino\libraries\GY953\src\GY953.cpp: In member function 'void GY953::enableInt()':
d:\Users\rkuo2\Documents\Arduino\libraries\GY953\src\GY953.cpp:121:3: error: 'attachInterrupt' was not declared in this scope
121 | attachInterrupt(0,isr,RISING);
| ^~~~~~~~~~~~~~~

EmotionDetectionNN

Based on RTSPFaceDetection.ino,
how do I create the following add into FDPostProcess ?

img = CV2.crop(frame)
img = CV2.rgb2gray(img)
img = CV2.resize(img, (48, 48))
emo = NNemotiondetection.predict(img)
my emotion detection model is trained by
kaggle.com/rkuo2000/fer2013

Pretrained README
file : fer2013_cnn.h5 (1.26MB)
total params = 103,143
input_shape = (48,48,1)
test accuracy = 54.89% (model size is minimized, so accuracy is reduced ! )

FaceMask Detection

Facemask dataset are 96x96 pictures, I have trained a CNN model file at kaggle.com/code/rkuo2000/facemask-cnn

still need to run MTCNN or FaceDetection with camera's image,
then crop the face and resize into 96x96 for detection.

Is it possible to modify these from your FaceDetection example ?
Or should I directly go for training YOLOv7 with facemask data ?

如何在AMB82-Mini 實現自定義UART(TX,RX) Serial1 or Serial1 ports TXRX 與arduino UNO Serial1 ports TXRX 通訊交換資料?

最近買了amb82-mini 板子,但想要實現執行數個 Software serial ports,或者
想要同時併用 Hardware 與 Software serials,但是 Arduino 官方並不建議這樣作,
因為在一塊開發板上同時使用 Hardware+Software serial 或者執行多組的
Software serial,很容易產生傳輸瓶頸或亂碼,我試過後也是如此。

所以我想要先嘗試使用amb82-mini 板子 的 serial1 ports TXRX, serial2ports TXRX
但是目前官網上沒有寫如何使用到erial1 ports TXRX, serial2ports TXRX 只提供LOG_TX RX ARDUINO 範例 但顯然沒辦法達到我的目的!

Amb82mini send instant audio

Hardware Environment

Amb82mini

Related technical area

Websocket、SIP、I2S、WebRTC

Is the feature request related to an un-fixed issue?

Can send instant audio

Describe the ideal solution/reault/output.

Two-way audio when transmitting with communication equipment

Additional remarks

No response

I have checked existing/closed list of issues and the Contributing Guide.

  • I confirm I have checked existing/closed list of issues and the Contributing Guide.

Compilation Error : digitalPintoInterrupt

WARNING: library MPU6050 claims to run on avr, samd, sam, esp8266, esp32, stm32, renesas, renesas_portenta, renesas_uno architecture(s) and may be incompatible with your current board which runs on AmebaPro2 architecture(s).
D:\Users\rkuo2\Documents\Arduino\examples\IMU\MPU6050_DMP6_Teapot\MPU6050_DMP6_Teapot.ino: In function 'void setup()':
D:\Users\rkuo2\Documents\Arduino\examples\IMU\MPU6050_DMP6_Teapot\MPU6050_DMP6_Teapot.ino:135:18: error: 'digitalPinToInterrupt' was not declared in this scope; did you mean 'digitalPinToPort'?
135 | Serial.print(digitalPinToInterrupt(INTERRUPT_PIN));
| ^~~~~~~~~~~~~~~~~~~~~
| digitalPinToPort
D:\Users\rkuo2\Documents\Arduino\examples\IMU\MPU6050_DMP6_Teapot\MPU6050_DMP6_Teapot.ino:137:5: error: 'attachInterrupt' was not declared in this scope
137 | attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN), dmpDataReady, RISING);
| ^~~~~~~~~~~~~~~

exit status 1

Compilation error: 'digitalPinToInterrupt' was not declared in this scope; did you mean 'digitalPinToPort'?

PPPoS support on AMB82-Mini board?

Hi team, I am using EG95 (EG95 is a cell modem provided by Quecetel) with AMB82mini on UART1 for internet connectivity, I have tried to create PPPoS client for my AMB82-Mini board but I am having issues when Arduino tries to link the libraries, please see the below code and attached error.
If you know how it could be solved please provide help, Thanks in advance!

#include "netif/ppp/pppos.h"
#include "FreeRTOS.h"
#include "task.h"
#include <string.h>
#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_impl.h"
#include "netif/ppp/pppapi.h"
#include "lwip/sys.h"
#include "lwip/err.h"
#include "lwip/dns.h"
#include "tcpip.h"

#define PPP_IPV4_SUPPORT 1

char* ppp_user = "";
char* ppp_pass = "";
String APN = "hologram";

#define BUF_SIZE (1024)
bool PPPOS_firststart = false;
bool PPPOS_connected = false;
bool PPPOS_started = false;
char *PPP_User = "";
char *PPP_Pass = "";
char PPPOS_out[BUF_SIZE];
String buffer = "";

String data = "";
bool atMode = true;

/* The PPP control block */
ppp_pcb *ppp;



/* The PPP IP interface */
struct netif ppp_netif;


/* PPP status callback example */
void ppp_status_cb(ppp_pcb *pcb, int err_code, void *ctx)
{
    struct netif *pppif = ppp_netif(pcb);
    LWIP_UNUSED_ARG(ctx);

    switch (err_code) {
    case PPPERR_NONE: {
        Serial.println("status_cb: Connected\n");
    #if PPP_IPV4_SUPPORT
            Serial.print(ipaddr_ntoa(&pppif->ip_addr));
            Serial.print(ipaddr_ntoa(&pppif->gw));
            Serial.print(ipaddr_ntoa(&pppif->netmask));
    #endif /* PPP_IPV4_SUPPORT */
    #if PPP_IPV6_SUPPORT
            Serial.print(ip6addr_ntoa(netif_ip6_addr(pppif, 0)));
    #endif /* PPP_IPV6_SUPPORT */
          PPPOS_connected = true;
      
        break;
    }
    case PPPERR_PARAM: {
        Serial.print("status_cb: Invalid parameter\n");
        break;
    }
    case PPPERR_OPEN: {
        Serial.print("status_cb: Unable to open PPP session\n");
        break;
    }
    case PPPERR_DEVICE: {
        Serial.print("status_cb: Invalid I/O device for PPP\n");
        break;
    }
    case PPPERR_ALLOC: {
        Serial.print("status_cb: Unable to allocate resources\n");
        break;
    }
    case PPPERR_USER: {
       Serial.print("status_cb: User interrupt\n");
       PPPOS_started = false;
       PPPOS_connected = false;
       break;
    }
    case PPPERR_CONNECT: {
       Serial.print("status_cb: Connection lost\n");
       PPPOS_started = false;
       PPPOS_connected = false;
       break;
    }
    case PPPERR_AUTHFAIL: {
        Serial.print("status_cb: Failed authentication challenge\n");
        PPPOS_started = false;
        PPPOS_connected = false;
        break;
    }
    case PPPERR_PROTOCOL: {
        Serial.print("status_cb: Failed to meet protocol\n");
        PPPOS_started = false;
        PPPOS_connected = false;
        break;
    }
    case PPPERR_PEERDEAD: {
        Serial.print("status_cb: Connection timeout\n");
        PPPOS_started = false;
        PPPOS_connected = false;
        break;
    }
    case PPPERR_IDLETIMEOUT: {
        Serial.print("status_cb: Idle Timeout\n");
        PPPOS_started = false;
        PPPOS_connected = false;
        break;
    }
    case PPPERR_CONNECTTIME: {
        Serial.print("status_cb: Max connect time reached\n");
        PPPOS_started = false;
        PPPOS_connected = false;
        break;
    }
    case PPPERR_LOOPBACK: {
        Serial.print("status_cb: Loopback detected\n");
        PPPOS_started = false;
        PPPOS_connected = false;
        break;
    }
    default: {
        Serial.println("status_cb: Unknown error code \n");
        Serial.print(err_code);
        PPPOS_started = false;
        PPPOS_connected = false;
        break;
    }
    }

    if (err_code == PPPERR_NONE) {
        return;
    }
    if (err_code == PPPERR_USER) {
        return;
    }
}


u32_t ppp_output_callback(ppp_pcb *pcb, u8_t *cmd, u32_t len, void *ctx)
{
  if (cmd != NULL) {
    for (u32_t i = 0; i < len; i++)
    {
      Serial1.print(cmd[i]);
    }
     return len;
  }
  else
  {
    Serial.println("error in ppp_output_callback");
    return -1;
  }
    
}


bool PPPOS_status(){
  return PPPOS_started;
}

void PPPOS_stop(){
  ppp_close(ppp, 0); 
}

String PPPOS_read(){
    String ss = "";
    while (Serial1.available())
    {
       char c = Serial1.read();
        ss+=c;
    }
    if (ss != " ") {
        return ss;
    } else {
        return "";
    }
}

void PPPOS_print(char* cmd){
  if (cmd != NULL) {
     int cmdSize = strlen(cmd);
     for (int i = 0; i < cmdSize; i++)
     {
        Serial1.print(cmd[i]);
     }
     
  }
}


void pppos_client_task(void *pvParameters)
{
    while (1) {  
        while (PPPOS_started && Serial1.available()) {
            // String ss = "";
            // char len = Serial1.read();
            // ss += len;
            // if (len > 0) {
            //     pppos_input(ppp, (uint8_t *)ss.c_str(), ss.length());
            // }

            char dataByte;
            while (Serial1.available()) {
                dataByte = Serial1.read();
                pppos_input(ppp, (uint8_t *)&dataByte, 1);
            }
            vTaskDelay(10 / portTICK_PERIOD_MS);
        }
        vTaskDelay(100 / portTICK_PERIOD_MS);
       }
      
    
}


bool PPPOS_isConnected(){
  return PPPOS_connected;
}

void PPPOS_start(){
  if (!PPPOS_firststart){
        ppp = pppos_create(&ppp_netif, ppp_output_callback, ppp_status_cb, NULL);
     
        if (ppp == NULL) {
            return;
        }
  }
        ppp_set_default(ppp);
        ppp_set_auth(ppp, PPPAUTHTYPE_ANY, "", "");
        ppp_set_usepeerdns(ppp, 1);
        ppp_connect(ppp, 0);
        
        PPPOS_started = true;
        PPPOS_firststart = true;
}


bool sendCommandWithAnswer(String cmd, String ans){
         PPPOS_print((char *)cmd.c_str());
         unsigned long _tg = millis();
         while(true){
          data = PPPOS_read();
          if (data != NULL){
            // char* dataCopy = strdup(data.c_str());
            char* dataCopy = &data[0];
            char* command = strtok(dataCopy, "\n");
            while (command != 0)
            {
              buffer = String(command);
              buffer.replace("\r", "");
              command = strtok(0, "\n");
              if (buffer != "") { Serial.println(buffer); }
              if (buffer == ans) {buffer = ""; return true; }
              buffer = "";
            } 
            free(dataCopy);
          }
            if (millis() > (_tg + 5000)) { buffer = ""; return false; } 
         }
         buffer = "";
         return false;
}

bool startPPPOS(){  
      String apnSet = "AT+CGDCONT=1,\"IP\",\"" + APN + "\"\n";
      if (!sendCommandWithAnswer(apnSet, "OK")) 
      { 
         Serial.println("issues in apnSet"); 
        return false; }
      if (!sendCommandWithAnswer("AT+CGDATA=\"PPP\",1\n", "CONNECT")) 
      { 
        Serial.println("issues in CGDATA"); 
        return false; }

      atMode = false;
      PPPOS_start(); 
      unsigned long _tg = millis();
      while(!PPPOS_isConnected()) {
        if (millis() > (_tg + 10000)) { PPPOS_stop();  atMode = true; return false; }
      }
      Serial.println("PPPOS Started");
      return true;
}

void PPPOS_init(){
  xTaskCreate(&pppos_client_task, "pppos_client_task", 10048, NULL, 5, NULL);
}

void setup()
{
 
  // Start the serial communication with the PC
  Serial.begin(115200);

  delay(100);

  Serial1.end();
  Serial1.begin(115200);

  //Disable the echo it's important to run the modem thru Arduino
  Serial1.println("E0");
  String sK =  readResponse();
 
  delay(100);

  PPPOS_init();

  Serial.println("Starting PPPOS...");
  if (startPPPOS()) { Serial.println("Starting PPPOS... OK"); } else { Serial.println("Starting PPPOS... Failed"); }

}

void loop()
{ 
  if (!PPPOS_isConnected() || atMode){
    data = PPPOS_read();
    if (data != NULL){
      Serial.println(data);  
    }
  }
  
}


//this function reads character if available from modem's uart(SERIAL1), also it prints the received data over serial(SERIAL0) line of controller.
String readResponse() {
  String response = "";
  while (Serial1.available()) {
    char c = Serial1.read();
    response += c;
     Serial.print(c);
  }
  return response;
}

This is my pppopts.h file, I have enabled support for PPP, also changed some other parameters as well:

/*
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice,
 *    this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 * 3. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
 * OF SUCH DAMAGE.
 *
 * This file is part of the lwIP TCP/IP stack.
 *
 */

#ifndef LWIP_PPP_OPTS_H
#define LWIP_PPP_OPTS_H

#include "lwip/opt.h"

/**
 * PPP_SUPPORT==1: Enable PPP.
 */
#ifndef PPP_SUPPORT
#define PPP_SUPPORT                     1
#endif

/**
 * PPPOE_SUPPORT==1: Enable PPP Over Ethernet
 */
#ifndef PPPOE_SUPPORT
#define PPPOE_SUPPORT                   0
#endif

/**
 * PPPOL2TP_SUPPORT==1: Enable PPP Over L2TP
 */
#ifndef PPPOL2TP_SUPPORT
#define PPPOL2TP_SUPPORT                0
#endif

/**
 * PPPOL2TP_AUTH_SUPPORT==1: Enable PPP Over L2TP Auth (enable MD5 support)
 */
#ifndef PPPOL2TP_AUTH_SUPPORT
#define PPPOL2TP_AUTH_SUPPORT           PPPOL2TP_SUPPORT
#endif

/**
 * PPPOS_SUPPORT==1: Enable PPP Over Serial
 */
#ifndef PPPOS_SUPPORT
#define PPPOS_SUPPORT                   PPP_SUPPORT
#endif

/**
 * LWIP_PPP_API==1: Enable PPP API (in pppapi.c)
 */
#ifndef LWIP_PPP_API
#define LWIP_PPP_API                    1//(PPP_SUPPORT && (NO_SYS == 0))
#endif

#if PPP_SUPPORT

/**
 * MEMP_NUM_PPP_PCB: the number of simultaneously active PPP
 * connections (requires the PPP_SUPPORT option)
 */
#ifndef MEMP_NUM_PPP_PCB
#define MEMP_NUM_PPP_PCB                1
#endif

/**
 * PPP_NUM_TIMEOUTS_PER_PCB: the number of sys_timeouts running in parallel per
 * ppp_pcb. See the detailed explanation at the end of ppp_impl.h about simultaneous
 * timers analysis.
 */
#ifndef PPP_NUM_TIMEOUTS_PER_PCB
#define PPP_NUM_TIMEOUTS_PER_PCB        (1 + PPP_IPV4_SUPPORT + PPP_IPV6_SUPPORT + CCP_SUPPORT)
#endif

/* The number of sys_timeouts required for the PPP module */
#define PPP_NUM_TIMEOUTS                (PPP_SUPPORT * PPP_NUM_TIMEOUTS_PER_PCB * MEMP_NUM_PPP_PCB)

/**
 * MEMP_NUM_PPPOS_INTERFACES: the number of concurrently active PPPoS
 * interfaces (only used with PPPOS_SUPPORT==1)
 */
#ifndef MEMP_NUM_PPPOS_INTERFACES
#define MEMP_NUM_PPPOS_INTERFACES       MEMP_NUM_PPP_PCB
#endif

/**
 * MEMP_NUM_PPPOE_INTERFACES: the number of concurrently active PPPoE
 * interfaces (only used with PPPOE_SUPPORT==1)
 */
#ifndef MEMP_NUM_PPPOE_INTERFACES
#define MEMP_NUM_PPPOE_INTERFACES       1
#endif

/**
 * MEMP_NUM_PPPOL2TP_INTERFACES: the number of concurrently active PPPoL2TP
 * interfaces (only used with PPPOL2TP_SUPPORT==1)
 */
#ifndef MEMP_NUM_PPPOL2TP_INTERFACES
#define MEMP_NUM_PPPOL2TP_INTERFACES       1
#endif

/**
 * MEMP_NUM_PPP_API_MSG: Number of concurrent PPP API messages (in pppapi.c)
 */
#ifndef MEMP_NUM_PPP_API_MSG
#define MEMP_NUM_PPP_API_MSG 5
#endif

/**
 * PPP_DEBUG: Enable debugging for PPP.
 */
#ifndef PPP_DEBUG
#define PPP_DEBUG                       LWIP_DBG_ON
#endif

/**
 * PPP_INPROC_IRQ_SAFE==1 call pppos_input() using tcpip_callback().
 *
 * Please read the "PPPoS input path" chapter in the PPP documentation about this option.
 */
#ifndef PPP_INPROC_IRQ_SAFE
#define PPP_INPROC_IRQ_SAFE             1
#endif

/**
 * PRINTPKT_SUPPORT==1: Enable PPP print packet support
 *
 * Mandatory for debugging, it displays exchanged packet content in debug trace.
 */
#ifndef PRINTPKT_SUPPORT
#define PRINTPKT_SUPPORT                1
#endif

/**
 * PPP_IPV4_SUPPORT==1: Enable PPP IPv4 support
 */
#ifndef PPP_IPV4_SUPPORT
#define PPP_IPV4_SUPPORT                (LWIP_IPV4)
#endif

/**
 * PPP_IPV6_SUPPORT==1: Enable PPP IPv6 support
 */
#ifndef PPP_IPV6_SUPPORT
#define PPP_IPV6_SUPPORT                (LWIP_IPV6)
#endif

/**
 * PPP_NOTIFY_PHASE==1: Support PPP notify phase support
 *
 * PPP notify phase support allows you to set a callback which is
 * called on change of the internal PPP state machine.
 *
 * This can be used for example to set a LED pattern depending on the
 * current phase of the PPP session.
 */
#ifndef PPP_NOTIFY_PHASE
#define PPP_NOTIFY_PHASE                0
#endif

/**
 * pbuf_type PPP is using for LCP, PAP, CHAP, EAP, CCP, IPCP and IP6CP packets.
 *
 * Memory allocated must be single buffered for PPP to works, it requires pbuf
 * that are not going to be chained when allocated. This requires setting
 * PBUF_POOL_BUFSIZE to at least 512 bytes, which is quite huge for small systems.
 *
 * Setting PPP_USE_PBUF_RAM to 1 makes PPP use memory from heap where continuous
 * buffers are required, allowing you to use a smaller PBUF_POOL_BUFSIZE.
 */
#ifndef PPP_USE_PBUF_RAM
#define PPP_USE_PBUF_RAM                1
#endif

/**
 * PPP_FCS_TABLE: Keep a 256*2 byte table to speed up FCS calculation for PPPoS
 */
#ifndef PPP_FCS_TABLE
#define PPP_FCS_TABLE                   1
#endif

/**
 * PAP_SUPPORT==1: Support PAP.
 */
#ifndef PAP_SUPPORT
#define PAP_SUPPORT                     1
#endif

/**
 * CHAP_SUPPORT==1: Support CHAP.
 */
#ifndef CHAP_SUPPORT
#define CHAP_SUPPORT                    1
#endif

/**
 * MSCHAP_SUPPORT==1: Support MSCHAP.
 */
#ifndef MSCHAP_SUPPORT
#define MSCHAP_SUPPORT                  1
#endif
#if MSCHAP_SUPPORT
/* MSCHAP requires CHAP support */
#undef CHAP_SUPPORT
#define CHAP_SUPPORT                    1
#endif /* MSCHAP_SUPPORT */

/**
 * EAP_SUPPORT==1: Support EAP.
 */
#ifndef EAP_SUPPORT
#define EAP_SUPPORT                     1
#endif

/**
 * CCP_SUPPORT==1: Support CCP.
 */
#ifndef CCP_SUPPORT
#define CCP_SUPPORT                     1
#endif

/**
 * MPPE_SUPPORT==1: Support MPPE.
 */
#ifndef MPPE_SUPPORT
#define MPPE_SUPPORT                    1
#endif
#if MPPE_SUPPORT
/* MPPE requires CCP support */
#undef CCP_SUPPORT
#define CCP_SUPPORT                     1
/* MPPE requires MSCHAP support */
#undef MSCHAP_SUPPORT
#define MSCHAP_SUPPORT                  1
/* MSCHAP requires CHAP support */
#undef CHAP_SUPPORT
#define CHAP_SUPPORT                    1
#endif /* MPPE_SUPPORT */

/**
 * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
 */
#ifndef CBCP_SUPPORT
#define CBCP_SUPPORT                    0
#endif

/**
 * ECP_SUPPORT==1: Support ECP. CURRENTLY NOT SUPPORTED! DO NOT SET!
 */
#ifndef ECP_SUPPORT
#define ECP_SUPPORT                     0
#endif

/**
 * DEMAND_SUPPORT==1: Support dial on demand. CURRENTLY NOT SUPPORTED! DO NOT SET!
 */
#ifndef DEMAND_SUPPORT
#define DEMAND_SUPPORT                  0
#endif

/**
 * LQR_SUPPORT==1: Support Link Quality Report. Do nothing except exchanging some LCP packets.
 */
#ifndef LQR_SUPPORT
#define LQR_SUPPORT                     1
#endif

/**
 * PPP_SERVER==1: Enable PPP server support (waiting for incoming PPP session).
 *
 * Currently only supported for PPPoS.
 */
#ifndef PPP_SERVER
#define PPP_SERVER                      0
#endif

#if PPP_SERVER
/*
 * PPP_OUR_NAME: Our name for authentication purposes
 */
#ifndef PPP_OUR_NAME
#define PPP_OUR_NAME                    "lwIP"
#endif
#endif /* PPP_SERVER */

/**
 * VJ_SUPPORT==1: Support VJ header compression.
 */
#ifndef VJ_SUPPORT
#define VJ_SUPPORT                      1
#endif
/* VJ compression is only supported for TCP over IPv4 over PPPoS. */
#if !PPPOS_SUPPORT || !PPP_IPV4_SUPPORT || !LWIP_TCP
#undef VJ_SUPPORT
#define VJ_SUPPORT                      0
#endif /* !PPPOS_SUPPORT */

/**
 * PPP_MD5_RANDM==1: Use MD5 for better randomness.
 * Enabled by default if CHAP, EAP, or L2TP AUTH support is enabled.
 */
#ifndef PPP_MD5_RANDM
#define PPP_MD5_RANDM                   (CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT)
#endif

/**
 * PolarSSL embedded library
 *
 *
 * lwIP contains some files fetched from the latest BSD release of
 * the PolarSSL project (PolarSSL 0.10.1-bsd) for ciphers and encryption
 * methods we need for lwIP PPP support.
 *
 * The PolarSSL files were cleaned to contain only the necessary struct
 * fields and functions needed for lwIP.
 *
 * The PolarSSL API was not changed at all, so if you are already using
 * PolarSSL you can choose to skip the compilation of the included PolarSSL
 * library into lwIP.
 *
 * If you are not using the embedded copy you must include external
 * libraries into your arch/cc.h port file.
 *
 * Beware of the stack requirements which can be a lot larger if you are not
 * using our cleaned PolarSSL library.
 */

/**
 * LWIP_USE_EXTERNAL_POLARSSL: Use external PolarSSL library
 */
#ifndef LWIP_USE_EXTERNAL_POLARSSL
#define LWIP_USE_EXTERNAL_POLARSSL      0
#endif

/**
 * LWIP_USE_EXTERNAL_MBEDTLS: Use external mbed TLS library
 */
#ifndef LWIP_USE_EXTERNAL_MBEDTLS
#define LWIP_USE_EXTERNAL_MBEDTLS       0
#endif

/*
 * PPP Timeouts
 */

/**
 * FSM_DEFTIMEOUT: Timeout time in seconds
 */
#ifndef FSM_DEFTIMEOUT
#define FSM_DEFTIMEOUT                  6
#endif

/**
 * FSM_DEFMAXTERMREQS: Maximum Terminate-Request transmissions
 */
#ifndef FSM_DEFMAXTERMREQS
#define FSM_DEFMAXTERMREQS              2
#endif

/**
 * FSM_DEFMAXCONFREQS: Maximum Configure-Request transmissions
 */
#ifndef FSM_DEFMAXCONFREQS
#define FSM_DEFMAXCONFREQS              10
#endif

/**
 * FSM_DEFMAXNAKLOOPS: Maximum number of nak loops
 */
#ifndef FSM_DEFMAXNAKLOOPS
#define FSM_DEFMAXNAKLOOPS              5
#endif

/**
 * UPAP_DEFTIMEOUT: Timeout (seconds) for retransmitting req
 */
#ifndef UPAP_DEFTIMEOUT
#define UPAP_DEFTIMEOUT                 6
#endif

/**
 * UPAP_DEFTRANSMITS: Maximum number of auth-reqs to send
 */
#ifndef UPAP_DEFTRANSMITS
#define UPAP_DEFTRANSMITS               10
#endif

#if PPP_SERVER
/**
 * UPAP_DEFREQTIME: Time to wait for auth-req from peer
 */
#ifndef UPAP_DEFREQTIME
#define UPAP_DEFREQTIME                 30
#endif
#endif /* PPP_SERVER */

/**
 * CHAP_DEFTIMEOUT: Timeout (seconds) for retransmitting req
 */
#ifndef CHAP_DEFTIMEOUT
#define CHAP_DEFTIMEOUT                 6
#endif

/**
 * CHAP_DEFTRANSMITS: max # times to send challenge
 */
#ifndef CHAP_DEFTRANSMITS
#define CHAP_DEFTRANSMITS               10
#endif

#if PPP_SERVER
/**
 * CHAP_DEFRECHALLENGETIME: If this option is > 0, rechallenge the peer every n seconds
 */
#ifndef CHAP_DEFRECHALLENGETIME
#define CHAP_DEFRECHALLENGETIME         0
#endif
#endif /* PPP_SERVER */

/**
 * EAP_DEFREQTIME: Time to wait for peer request
 */
#ifndef EAP_DEFREQTIME
#define EAP_DEFREQTIME                  6
#endif

/**
 * EAP_DEFALLOWREQ: max # times to accept requests
 */
#ifndef EAP_DEFALLOWREQ
#define EAP_DEFALLOWREQ                 10
#endif

#if PPP_SERVER
/**
 * EAP_DEFTIMEOUT: Timeout (seconds) for rexmit
 */
#ifndef EAP_DEFTIMEOUT
#define EAP_DEFTIMEOUT                  6
#endif

/**
 * EAP_DEFTRANSMITS: max # times to transmit
 */
#ifndef EAP_DEFTRANSMITS
#define EAP_DEFTRANSMITS                10
#endif
#endif /* PPP_SERVER */

/**
 * LCP_DEFLOOPBACKFAIL: Default number of times we receive our magic number from the peer
 * before deciding the link is looped-back.
 */
#ifndef LCP_DEFLOOPBACKFAIL
#define LCP_DEFLOOPBACKFAIL             10
#endif

/**
 * LCP_ECHOINTERVAL: Interval in seconds between keepalive echo requests, 0 to disable.
 */
#ifndef LCP_ECHOINTERVAL
#define LCP_ECHOINTERVAL                1
#endif

/**
 * LCP_MAXECHOFAILS: Number of unanswered echo requests before failure.
 */
#ifndef LCP_MAXECHOFAILS
#define LCP_MAXECHOFAILS                3
#endif

/**
 * PPP_MAXIDLEFLAG: Max Xmit idle time (in ms) before resend flag char.
 */
#ifndef PPP_MAXIDLEFLAG
#define PPP_MAXIDLEFLAG                 100
#endif

/**
 * PPP Packet sizes
 */

/**
 * PPP_MRU: Default MRU
 */
#ifndef PPP_MRU
#define PPP_MRU                         1500
#endif

/**
 * PPP_DEFMRU: Default MRU to try
 */
#ifndef PPP_DEFMRU
#define PPP_DEFMRU                      1500
#endif

/**
 * PPP_MAXMRU: Normally limit MRU to this (pppd default = 16384)
 */
#ifndef PPP_MAXMRU
#define PPP_MAXMRU                      1500
#endif

/**
 * PPP_MINMRU: No MRUs below this
 */
#ifndef PPP_MINMRU
#define PPP_MINMRU                      128
#endif

/**
 * PPPOL2TP_DEFMRU: Default MTU and MRU for L2TP
 * Default = 1500 - PPPoE(6) - PPP Protocol(2) - IPv4 header(20) - UDP Header(8)
 * - L2TP Header(6) - HDLC Header(2) - PPP Protocol(2) - MPPE Header(2) - PPP Protocol(2)
 */
#if PPPOL2TP_SUPPORT
#ifndef PPPOL2TP_DEFMRU
#define PPPOL2TP_DEFMRU                 1450
#endif
#endif /* PPPOL2TP_SUPPORT */

/**
 * MAXNAMELEN: max length of hostname or name for auth
 */
#ifndef MAXNAMELEN
#define MAXNAMELEN                      256
#endif

/**
 * MAXSECRETLEN: max length of password or secret
 */
#ifndef MAXSECRETLEN
#define MAXSECRETLEN                    256
#endif

/* ------------------------------------------------------------------------- */

/*
 * Build triggers for embedded PolarSSL
 */
#if !LWIP_USE_EXTERNAL_POLARSSL && !LWIP_USE_EXTERNAL_MBEDTLS

/* CHAP, EAP, L2TP AUTH and MD5 Random require MD5 support */
#if CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT || PPP_MD5_RANDM
#define LWIP_INCLUDED_POLARSSL_MD5      1
#endif /* CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT || PPP_MD5_RANDM */

#if MSCHAP_SUPPORT

/* MSCHAP require MD4 support */
#define LWIP_INCLUDED_POLARSSL_MD4      1
/* MSCHAP require SHA1 support */
#define LWIP_INCLUDED_POLARSSL_SHA1     1
/* MSCHAP require DES support */
#define LWIP_INCLUDED_POLARSSL_DES      1

/* MS-CHAP support is required for MPPE */
#if MPPE_SUPPORT
/* MPPE require ARC4 support */
#define LWIP_INCLUDED_POLARSSL_ARC4     1
#endif /* MPPE_SUPPORT */

#endif /* MSCHAP_SUPPORT */

#endif /* !LWIP_USE_EXTERNAL_POLARSSL && !LWIP_USE_EXTERNAL_MBEDTLS */

/* Default value if unset */
#ifndef LWIP_INCLUDED_POLARSSL_MD4
#define LWIP_INCLUDED_POLARSSL_MD4      0
#endif /* LWIP_INCLUDED_POLARSSL_MD4 */
#ifndef LWIP_INCLUDED_POLARSSL_MD5
#define LWIP_INCLUDED_POLARSSL_MD5      0
#endif /* LWIP_INCLUDED_POLARSSL_MD5 */
#ifndef LWIP_INCLUDED_POLARSSL_SHA1
#define LWIP_INCLUDED_POLARSSL_SHA1     0
#endif /* LWIP_INCLUDED_POLARSSL_SHA1 */
#ifndef LWIP_INCLUDED_POLARSSL_DES
#define LWIP_INCLUDED_POLARSSL_DES      0
#endif /* LWIP_INCLUDED_POLARSSL_DES */
#ifndef LWIP_INCLUDED_POLARSSL_ARC4
#define LWIP_INCLUDED_POLARSSL_ARC4     0
#endif /* LWIP_INCLUDED_POLARSSL_ARC4 */

#endif /* PPP_SUPPORT */

/* Default value if unset */
#ifndef PPP_NUM_TIMEOUTS
#define PPP_NUM_TIMEOUTS                0
#endif /* PPP_NUM_TIMEOUTS */

#endif /* LWIP_PPP_OPTS_H */

This is the exact issue I am facing, directly copied from Arduino Serial Monitor:

c:/users/abhishek.shukla/appdata/local/arduino15/packages/realtek/tools/ameba_pro2_toolchain/1.0.1-p1/bin/../lib/gcc/arm-none-eabi/10.3.0/../../../../arm-none-eabi/bin/ld.exe: C:\Users\abhishek.shukla\AppData\Local\Temp\arduino\sketches\9194102C42145A6333A404D5D158324C\sketch\Iteration1.ino.cpp.o: in function `PPPOS_stop()':
Iteration1.ino.cpp:(.text._Z10PPPOS_stopv+0x8): undefined reference to `ppp_close'
c:/users/abhishek.shukla/appdata/local/arduino15/packages/realtek/tools/ameba_pro2_toolchain/1.0.1-p1/bin/../lib/gcc/arm-none-eabi/10.3.0/../../../../arm-none-eabi/bin/ld.exe: C:\Users\abhishek.shukla\AppData\Local\Temp\arduino\sketches\9194102C42145A6333A404D5D158324C\sketch\Iteration1.ino.cpp.o: in function `PPPOS_start()':
Iteration1.ino.cpp:(.text._Z11PPPOS_startv+0x1a): undefined reference to `ppp_set_auth'
c:/users/abhishek.shukla/appdata/local/arduino15/packages/realtek/tools/ameba_pro2_toolchain/1.0.1-p1/bin/../lib/gcc/arm-none-eabi/10.3.0/../../../../arm-none-eabi/bin/ld.exe: Iteration1.ino.cpp:(.text._Z11PPPOS_startv+0x2a): undefined reference to `ppp_connect'
c:/users/abhishek.shukla/appdata/local/arduino15/packages/realtek/tools/ameba_pro2_toolchain/1.0.1-p1/bin/../lib/gcc/arm-none-eabi/10.3.0/../../../../arm-none-eabi/bin/ld.exe: Iteration1.ino.cpp:(.text._Z11PPPOS_startv+0x3e): undefined reference to `pppos_create'
c:/users/abhishek.shukla/appdata/local/arduino15/packages/realtek/tools/ameba_pro2_toolchain/1.0.1-p1/bin/../lib/gcc/arm-none-eabi/10.3.0/../../../../arm-none-eabi/bin/ld.exe: C:\Users\abhishek.shukla\AppData\Local\Temp\arduino\sketches\9194102C42145A6333A404D5D158324C\sketch\Iteration1.ino.cpp.o: in function `pppos_client_task(void*)':
Iteration1.ino.cpp:(.text._Z17pppos_client_taskPv+0x2e): undefined reference to `pppos_input'
collect2.exe: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1

I raised this issue here on the official forum - Forum Link

On the forum, Support engineer suggested me that probably the low level design hasn't been implemented for PPPoS. I request you engineers to please provide support for this feature, since my project is based on this feature. If you need any other details, please don't hesitate to ask, Thanks!!

AMB82 mini IPv6 connection support

Hello
Currently encountering the problem of making https request to a server that only provides IPv6 connection.
Hope you can help improve related functions.

thank you

MPU6050 Library example compilation failed

I am using MPU6050 Library by Electric Cats

Its examples will have the following errors in compilation : dtostrf and printfloatx are missing

WARNING: library MPU6050 claims to run on avr, samd, sam, esp8266, esp32, stm32, renesas, renesas_portenta, renesas_uno architecture(s) and may be incompatible with your current board which runs on AmebaPro2 architecture(s).
d:\Users\rkuo2\Documents\Arduino\libraries\MPU6050\src\MPU6050.cpp: In member function 'void MPU6050::PrintActiveOffsets()':
d:\Users\rkuo2\Documents\Arduino\libraries\MPU6050\src\MPU6050.cpp:3379:20: error: 'dtostrf' was not declared in this scope
3379 | Serial.print(dtostrf((float)Variable, Spaces, Precision, S));
| ^~~~~~~
d:\Users\rkuo2\Documents\Arduino\libraries\MPU6050\src\MPU6050.cpp:3398:3: note: in expansion of macro 'printfloatx'
3398 | printfloatx("", Data[0], 5, 0, ", ");
| ^~~~~~~~~~~
d:\Users\rkuo2\Documents\Arduino\libraries\MPU6050\src\MPU6050.cpp:3379:20: error: 'dtostrf' was not declared in this scope
3379 | Serial.print(dtostrf((float)Variable, Spaces, Precision, S));
| ^~~~~~~
d:\Users\rkuo2\Documents\Arduino\libraries\MPU6050\src\MPU6050.cpp:3399:3: note: in expansion of macro 'printfloatx'
3399 | printfloatx("", Data[1], 5, 0, ", ");
| ^~~~~~~~~~~
d:\Users\rkuo2\Documents\Arduino\libraries\MPU6050\src\MPU6050.cpp:3379:20: error: 'dtostrf' was not declared in this scope
3379 | Serial.print(dtostrf((float)Variable, Spaces, Precision, S));
| ^~~~~~~
d:\Users\rkuo2\Documents\Arduino\libraries\MPU6050\src\MPU6050.cpp:3400:3: note: in expansion of macro 'printfloatx'
3400 | printfloatx("", Data[2], 5, 0, ", ");
| ^~~~~~~~~~~
d:\Users\rkuo2\Documents\Arduino\libraries\MPU6050\src\MPU6050.cpp:3379:20: error: 'dtostrf' was not declared in this scope
3379 | Serial.print(dtostrf((float)Variable, Spaces, Precision, S));
| ^~~~~~~
d:\Users\rkuo2\Documents\Arduino\libraries\MPU6050\src\MPU6050.cpp:3403:3: note: in expansion of macro 'printfloatx'
3403 | printfloatx("", Data[0], 5, 0, ", ");
| ^~~~~~~~~~~
d:\Users\rkuo2\Documents\Arduino\libraries\MPU6050\src\MPU6050.cpp:3379:20: error: 'dtostrf' was not declared in this scope
3379 | Serial.print(dtostrf((float)Variable, Spaces, Precision, S));
| ^~~~~~~
d:\Users\rkuo2\Documents\Arduino\libraries\MPU6050\src\MPU6050.cpp:3404:3: note: in expansion of macro 'printfloatx'
3404 | printfloatx("", Data[1], 5, 0, ", ");
| ^~~~~~~~~~~
d:\Users\rkuo2\Documents\Arduino\libraries\MPU6050\src\MPU6050.cpp:3379:20: error: 'dtostrf' was not declared in this scope
3379 | Serial.print(dtostrf((float)Variable, Spaces, Precision, S));
| ^~~~~~~
d:\Users\rkuo2\Documents\Arduino\libraries\MPU6050\src\MPU6050.cpp:3405:3: note: in expansion of macro 'printfloatx'
3405 | printfloatx("", Data[2], 5, 0, "\n");
| ^~~~~~~~~~~

exit status 1

Compilation error: exit status 1

MPU9250_DMP_Gyro_Cal.ino compilation errors

Library : https://github.com/sparkfun/SparkFun_MPU-9250-DMP_Arduino_Library

WARNING: library SparkFun MPU-9250 Digital Motion Processing (DMP) Arduino Library claims to run on samd architecture(s) and may be incompatible with your current board which runs on AmebaPro2 architecture(s).
d:\Users\rkuo2\Documents\Arduino\libraries\SparkFun_MPU-9250-DMP_Arduino_Library-master\src\util\arduino_mpu9250_log.cpp: In function 'int _MLPrintLog(int, const char*, const char*, ...)':
d:\Users\rkuo2\Documents\Arduino\libraries\SparkFun_MPU-9250-DMP_Arduino_Library-master\src\util\arduino_mpu9250_log.cpp:37:1: warning: no return statement in function returning non-void [-Wreturn-type]
37 | }
| ^
d:\Users\rkuo2\Documents\Arduino\libraries\SparkFun_MPU-9250-DMP_Arduino_Library-master\src\util\inv_mpu_dmp_motion_driver.c: In function 'dmp_set_accel_bias':
d:\Users\rkuo2\Documents\Arduino\libraries\SparkFun_MPU-9250-DMP_Arduino_Library-master\src\util\inv_mpu_dmp_motion_driver.c:605:5: warning: implicit declaration of function '__no_operation' [-Wimplicit-function-declaration]
605 | __no_operation();
| ^~~~~~~~~~~~~~
d:\Users\rkuo2\Documents\Arduino\libraries\SparkFun_MPU-9250-DMP_Arduino_Library-master\src\util\inv_mpu.c: In function 'reg_int_cb':
d:\Users\rkuo2\Documents\Arduino\libraries\SparkFun_MPU-9250-DMP_Arduino_Library-master\src\util\inv_mpu.c:52:1: warning: no return statement in function returning non-void [-Wreturn-type]
52 | }
| ^
d:\Users\rkuo2\Documents\Arduino\libraries\SparkFun_MPU-9250-DMP_Arduino_Library-master\src\util\inv_mpu.c: In function 'mpu_reg_dump':
d:\Users\rkuo2\Documents\Arduino\libraries\SparkFun_MPU-9250-DMP_Arduino_Library-master\src\util\inv_mpu.c:47:19: warning: implicit declaration of function '_MLPrintLog' [-Wimplicit-function-declaration]
47 | #define log_i _MLPrintLog
| ^~~~~~~~~~~
d:\Users\rkuo2\Documents\Arduino\libraries\SparkFun_MPU-9250-DMP_Arduino_Library-master\src\util\inv_mpu.c:612:9: note: in expansion of macro 'log_i'
612 | log_i("%#5x: %#5x\r\n", ii, data);
| ^~~~~

[BOOT Err]Invalid Image Mani Label

hi all,

i use empty example .ino to build and program success.

BootFromNORFlash
[Start Boot ROM...]
=== Load PARTBL ===

[BOOT Err]Invalid Image Mani Label!

[BOOT Err]StartUp@0x0: Invalid RAM Img Signature!Boot_err(0x11

windows 10,
arduino ide, 2.0.4
AmebaPro2,v4.0.2

it seem as program flash parameters setting issue?
my setting:
image

same issue:
https://forum.amebaiot.com/t/rtl8720c-flash-log/1239

rtp video stream

I want to transmit video via RTP, not RTSP.
rtp_control()
rtp_create()
rtp_destroy()
rtp_handle()
I want to use a function, but I want to know how to use it.

Please use library name same as library directory name

From code

https://github.com/arduino/arduino-cli/blob/fe6d7499eb5e0920419829371c0e11f9af000499/legacy/builder/unused_compiled_libraries_remover.go#L42-L46

Arduino builder will remove directory not using by check from directory name and library name (from library.properties).
So, Arduino builder will remove compiled library and rebuild every time.

By change library name saves me 5 second every compile.
When I using Watchdog, RTC, Multimedia, WiFi, Wire, Http, FileSystem.

I2C Wire.endTransmission resets I2C device

Hi,

when trying a super simple master/slave setup (AMB82-mini <> ESP32) i discovered tha endTransmission resets the i2c device here:

https://github.com/ambiot/ambpro2_arduino/blob/dev/Arduino_package/hardware/libraries/Wire/src/Wire.cpp

Line: 179 => i2c_reset(((i2c_t *)this->pI2C));

i2c_api.h

brief  Deinitializes the I2C device 
param  obj: i2c object define in application software.
retval none
  
void i2c_reset(i2c_t *obj);

Because of that the code gets stuck / hangs because the i2c got reset

MASTER (amb82):

#include <Wire.h>

#define I2C_SLAVE_ADDR 0x55

    void setup() {
    Serial.begin(115200);
    Wire.begin();
}

void loop() {
    
    int thres = 0;     
    Wire.requestFrom(I2C_SLAVE_ADDR, 1);         
    
    while (Wire.available()) { 
      thres = Wire.read();  
    }     
    delay(10);
    ///////////////////////////
    int tmpval = random(10,100); 
    Wire.beginTransmission(I2C_SLAVE_ADDR); 
    Wire.write(tmpval);            
    Wire.endTransmission(true);   
    delay(10);
}

SLAVE (ESP32):
#include <Wire.h>

#define I2C_SLAVE_ADDR 0x55

void onRequest(){ 
  Wire.write(random(1,10)); 
}

void onReceive(int len){  
  while(Wire.available()){
    int x = Wire.read();          
    Serial.println(x);  
  }
}

void setup ( void ) 
{ 
    Wire.setPins(23,19); 
    Wire.begin(I2C_DEV_ADDR );       
      
    Wire.onReceive(onReceive);
    Wire.onRequest(onRequest);
}
void loop ( void )
{ }

Of course, this it part of the dev branch,- the 4.0.5 release works as expected

If you don't think this is a problem please go ahead and close the issue.

Thanks

Play Audio In headphones from SD card using AMB82 mini

Hardware Environment

Amb82 mini

Related technical area

Audio

Is the feature request related to an un-fixed issue?

Yes

Describe the ideal solution/reault/output.

I have an amb82 mini board, I have connected audio jack to DAC and GND Pin and successfully streamed audio from vlc player of my laptop to my headphones connected to audio jack. Now I have an audio file , for example audio.mp3 placed in root directory of my sd card. I want that sd card audio file to play on headphones.

Additional remarks

I have an amb82 mini board, I have connected audio jack to DAC and GND Pin and successfully streamed audio from vlc player of my laptop to my headphones connected to audio jack. Now I have an audio file , for example audio.mp3 placed in root directory of my sd card. I want that sd card audio file to play on headphones.

I have checked existing/closed list of issues and the Contributing Guide.

  • I confirm I have checked existing/closed list of issues and the Contributing Guide.

[Linux(Ubuntu 22.04)] SDK problems: 2. Ommiting "common_nn_models" because 'cp -r' is not specified

Hi
I bought AMB82-MINI boards, and I tried several example sketches from AMB Pro 2 SDK 4.0.2 in Arduino IDE.
All of them are working good, when I do so ON WINDOWS.
But when I do same ON LINUX(Ubuntu 22.04 64bit), I got this message on Arduino IDE(1.8.19):

... cp: -r not specified; omitting directory '.../.arduino15/packages/realtek/hardware/AmebaPro2/4.0.2/variants/common_nn_models'

Please check this out.
Thanks in advance.

스크린샷 2023-04-16 23-46-07

U8g2 library compilation error

Boards

AMB82-mini

External Hardware

SSD1306 0.96" OLED

Hardware Configuration

SSD1306 0.96" OLED

Version

v4.0.6

IDE Name

Arduino IDE 2.3.0

Operating System

Ubuntu 22.04.3 LTS

Auto Flash Mode

Disable

Erase All Flash Memory (16MB)

Disable

Standard Lib

Arduino_STD_PRINTF

Upload Speed

2000000

Description

SSD1306 0.96" OLED

Sketch

https://github.com/rkuo2000/Arduino/blob/master/examples/Peripherals/SSD1306_U8g2/SSD1306_U8g2.ino

Error/Debug Message

In file included from /home/rkuo/Arduino/libraries/Adafruit_GFX_Library/Adafruit_GFX.h:13,
                 from /home/rkuo/Arduino/examples/Peripherals/SSD1306_U8g2/SSD1306_U8g2.ino:3:
/home/rkuo/Arduino/libraries/Adafruit_BusIO/Adafruit_SPIDevice.h:94:41: error: 'SPI_MODE0' was not declared in this scope; did you mean 'SWD_MODE'?
   94 |                      uint8_t dataMode = SPI_MODE0, SPIClass *theSPI = &SPI);
      |                                         ^~~~~~~~~
      |                                         SWD_MODE
/home/rkuo/Arduino/libraries/Adafruit_BusIO/Adafruit_SPIDevice.h:103:41: error: 'SPI_MODE0' was not declared in this scope; did you mean 'SWD_MODE'?
  103 |                      uint8_t dataMode = SPI_MODE0);
      |                                         ^~~~~~~~~
      |                                         SWD_MODE

exit status 1

Compilation error: exit status 1

Reproduce remarks

the code runs OK on NodeMCU-32S

I have checked online documentation, FAQ, GitHub Wiki and existing/closed issues.

  • I confirm I have checked online documentation, FAQ, GitHub Wiki and existing/closed issues.

MPU6050_raw.ino [ERROR] requestFrom: readed=1, quantity=14

Library: MPU6050 by Electronic Cats
MPU6050.h patch with #include <avr/dtostrf.h>

50,232,20713,4345,-7903,-4353
50,232,20713,4345,-7903,-4353

[ERROR] requestFrom: readed=1, quantity=14

47,-16159,-14109,8193,4071,22749
47,-16159,-14109,8193,4071,22749

[ERROR] requestFrom: readed=1, quantity=14

61,-18197,-18208,8440,20475,-4369
61,-18197,-18208,8440,20475,-4369

[Linux(Ubuntu 22.04)] SDK problems: 1. /dev/null.d not found ???

Hi
I bought AMB82-MINI boards, and I tried several example sketches from AMB Pro 2 SDK 4.0.2 in Arduino IDE.
All of them are working good, when I do so ON WINDOWS.
But when I do same ON LINUX(Ubuntu 22.04 64bit), I got this message on Arduino IDE(1.8.19):

... : fatal error: opening dependency file /dev/null.d: Permission denied ...

So after I created a symbolic link to /dev/null as "/dev/null.d", it worked fine.
Please check this out.
Thanks in advance.

스크린샷 2023-04-16 23-47-41

Random compilation error at ubuntu env

Boards

AMB82-mini

External Hardware

NA

Hardware Configuration

NA

Version

latest dev (checkout manually)

IDE Name

Arduino IDE 2.3.2

Operating System

windows 10

Auto Flash Mode

Disable

Erase All Flash Memory (16MB)

Disable

Standard Lib

Arduino_STD_PRINTF

Upload Speed

2000000

Description

random error, at GitHub workflow CI Compile Examples
Related to arduino tools of SDK.

Sketch

All default examples

Error/Debug Message

malloc(): invalid next size (unsorted)

Reproduce remarks

No response

I have checked online documentation, FAQ, GitHub Wiki and existing/closed issues.

  • I confirm I have checked online documentation, FAQ, GitHub Wiki and existing/closed issues.

Board Ameba_AMB82-MINI (platform AmebaPro2, package realtek) is unknown

Under a new ubuntu22.04 environment.

Arduino: 1.8.19 (Linux), Board: "AMB82-MINI, Disable, Disable, Normal Mode, Yes, Yes, NA"


Board Ameba_AMB82-MINI (platform AmebaPro2, package realtek) is unknown

Error compiling for board AMB82-MINI.


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

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.