How to convert .ino file into .bin file with "sketch + WiFi settings" from arduinoIDE to upload in S3 ESP8266 by "ESP8266 download tool"? - embedded

I want to flash S3 ESP8266 module by "ESP8266 download tool". In arduinoIDE, when my setUp is like, tools->Erase Flash: only sketch. I can easily convert the blink.ino code into .bin and can flash it to my S3 ESP8266 module via "ESP8266 download tool", and can really see it's BuiltIn led blinking.
But, when my setUp is like, tools->Erase Flash: sketch+WiFi settings. I can convert the blink.ino into .bin and can flash it to my S3 ESP8266 module via "ESP8266 download tool". But unfortunately it doesn't blink. My .ino code is simple.
void setup() {
pinMode(4, OUTPUT);
}
void loop() {
digitalWrite(4, HIGH);
delay(1000);
digitalWrite(4, LOW);
delay(1000);
}
Options selected in ArduinoIDE's Tools,
Board : NodeMCU 1.0(ESP-12E Module)
Flash Size : "4M (No SPIFFS)"
I think this issue is because of "build options" changes, but I don't know about it's solution.
Is there anyThing that I am missing out ? Please help.

Related

Arduino WiFi101 ConnectSSL fails to connect

Help! I am trying to use the Arduino WiFi101 library to connect to an existing SSL server. For troubleshooting - I'm actually connecting to www.howsmyssl.com. Whether I use the IP address or the host name, the connection fails every time. The board I am using is the Adafruit Feather M0 Wifi. I used the Firmware Updater to upload the certificate for www.howsmyssl.com to the board. Here is the code:
#include <stdint.h>
#include <WiFi101.h>
#include <stdlib.h>
WiFiSSLClient client;
char ssid[] = "SciAv";
char pass[] = "FlyAcclaim";
void setup() {
WiFi.setPins(8,7,4,2);
while ( WiFi.begin(ssid, pass) != WL_CONNECTED) {
Serial.println("Connecting to SciAv");
delay(10000);
}
Serial.println("WiFi Connected");
if (!client.connectSSL("www.howsmyssl.com",443)) {
Serial.println("Connection Failed");
}
else {
Serial.println("Connected");
}
}
void loop() {
if (client.connected()) {
Serial.println("Connect to host");
}
}
You verificate if the certificate upload succefully on the board? Because to connect a ssl connection the shield needs be loaded with the ssl certificate. You can try add this verification before the Wifi network connection:
// check for the presence of the shield:
if (WiFi.status() == WL_NO_SHIELD) {
Serial.println("WiFi shield not present");
// don't continue:
while (true);
}
Alternatively, you can try using method 'connect("www.howsmyssl.com",443)' instead of 'connectSSL..'. This is useful If you have a library that accepts only plain Client, but you want to force it to use SSL, keeping the same method names of the non SSL client.
I have the same problem with the NANO33 IoT board. I found that an SSL connect failed on a board with the latest microcode (revision 1.4.8), but worked on a board with back-level microcode (revision 1.2.3). Just swapping out the NANO33 board makes the problem show up or go away. Reflash the microcode to a working back-level version if you need an SSL internet connection, or wait for Arduino to fix their bug in the next microcode release. Arduino WiFiNINA library used was version 1.8.13.

How does Chromium define a System File?

After enabling chrome://flags/#native-file-system-api in my chrome 83.0.4103.61, I tried to access a folder with this new API
handle = await window.chooseFileSystemEntries({type: 'open-directory'})
I get the following error message:
(Can't open this folder because it contains system files.)
Can anyone please tell me what "system files" means/how they are detected and how I could access all but these "system files"?
They hard code it in a source file.
This link will rot once they rename the file (has already happened a couple times) so the relevant contents as of this post are:
const struct {
// base::BasePathKey value (or one of the platform specific extensions to it)
// for a path that should be blocked. Specify kNoBasePathKey if |path| should
// be used instead.
int base_path_key;
// Explicit path to block instead of using |base_path_key|. Set to nullptr to
// use |base_path_key| on its own. If both |base_path_key| and |path| are set,
// |path| is treated relative to the path |base_path_key| resolves to.
const base::FilePath::CharType* path;
// If this is set to kDontBlockChildren, only the given path and its parents
// are blocked. If this is set to kBlockAllChildren, all children of the given
// path are blocked as well. Finally if this is set to kBlockNestedDirectories
// access is allowed to individual files in the directory, but nested
// directories are still blocked.
// The BlockType of the nearest ancestor of a path to check is what ultimately
// determines if a path is blocked or not. If a blocked path is a descendent
// of another blocked path, then it may override the child-blocking policy of
// its ancestor. For example, if /home blocks all children, but
// /home/downloads does not, then /home/downloads/file.ext will *not* be
// blocked.
BlockType type;
} kBlockedPaths[] = {
// Don't allow users to share their entire home directory, entire desktop or
// entire documents folder, but do allow sharing anything inside those
// directories not otherwise blocked.
{base::DIR_HOME, nullptr, kDontBlockChildren},
{base::DIR_USER_DESKTOP, nullptr, kDontBlockChildren},
{chrome::DIR_USER_DOCUMENTS, nullptr, kDontBlockChildren},
// Similar restrictions for the downloads directory.
{chrome::DIR_DEFAULT_DOWNLOADS, nullptr, kDontBlockChildren},
{chrome::DIR_DEFAULT_DOWNLOADS_SAFE, nullptr, kDontBlockChildren},
// The Chrome installation itself should not be modified by the web.
{chrome::DIR_APP, nullptr, kBlockAllChildren},
// And neither should the configuration of at least the currently running
// Chrome instance (note that this does not take --user-data-dir command
// line overrides into account).
{chrome::DIR_USER_DATA, nullptr, kBlockAllChildren},
// ~/.ssh is pretty sensitive on all platforms, so block access to that.
{base::DIR_HOME, FILE_PATH_LITERAL(".ssh"), kBlockAllChildren},
// And limit access to ~/.gnupg as well.
{base::DIR_HOME, FILE_PATH_LITERAL(".gnupg"), kBlockAllChildren},
#if defined(OS_WIN)
// Some Windows specific directories to block, basically all apps, the
// operating system itself, as well as configuration data for apps.
{base::DIR_PROGRAM_FILES, nullptr, kBlockAllChildren},
{base::DIR_PROGRAM_FILESX86, nullptr, kBlockAllChildren},
{base::DIR_PROGRAM_FILES6432, nullptr, kBlockAllChildren},
{base::DIR_WINDOWS, nullptr, kBlockAllChildren},
{base::DIR_APP_DATA, nullptr, kBlockAllChildren},
{base::DIR_LOCAL_APP_DATA, nullptr, kBlockAllChildren},
{base::DIR_COMMON_APP_DATA, nullptr, kBlockAllChildren},
// Opening a file from an MTP device, such as a smartphone or a camera, is
// implemented by Windows as opening a file in the temporary internet files
// directory. To support that, allow opening files in that directory, but
// not whole directories.
{base::DIR_IE_INTERNET_CACHE, nullptr, kBlockNestedDirectories},
#endif
#if defined(OS_MAC)
// Similar Mac specific blocks.
{base::DIR_APP_DATA, nullptr, kBlockAllChildren},
{base::DIR_HOME, FILE_PATH_LITERAL("Library"), kBlockAllChildren},
#endif
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
// On Linux also block access to devices via /dev, as well as security
// sensitive data in /sys and /proc.
{kNoBasePathKey, FILE_PATH_LITERAL("/dev"), kBlockAllChildren},
{kNoBasePathKey, FILE_PATH_LITERAL("/sys"), kBlockAllChildren},
{kNoBasePathKey, FILE_PATH_LITERAL("/proc"), kBlockAllChildren},
// And block all of ~/.config, matching the similar restrictions on mac
// and windows.
{base::DIR_HOME, FILE_PATH_LITERAL(".config"), kBlockAllChildren},
// Block ~/.dbus as well, just in case, although there probably isn't much a
// website can do with access to that directory and its contents.
{base::DIR_HOME, FILE_PATH_LITERAL(".dbus"), kBlockAllChildren},
#endif
// TODO(https://crbug.com/984641): Refine this list, for example add
// XDG_CONFIG_HOME when it is not set ~/.config?
};
Note the bug url: https://crbug.com/984641

Smooth Streaming SDK for Windows 8 - Error with Headphones Plugged

I'm doing some tests with the Smooth Streaming Client SDK for Windows 8, and I have a very basic application playing a fullscreen video:
private MediaExtensionManager extensions = new MediaExtensionManager();
public MainPage()
{
this.InitializeComponent();
extensions.RegisterByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler", ".ism", "text/xml");
extensions.RegisterByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler", ".ism", "application/vnd.ms-sstr+xml");
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
string url = "http://my.smooth.streaming.url/manifest";
this.slPlayer.Source = new Uri(url);
this.slPlayer.Play();
}
This seems to be working fine, unless I plug my headphones, at which point the application stops working. Adding a handler for the MediaFailed event informs I'm getting a MF_MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED error.
Any idea what may be causing this?
Badaro, I just tried this and was not able to repro the problem (on both x86 & x64, both starting with and without headphones and switching during playback). My guess is that you are either:
1) running into a driver issue.
2) there is something specific about the way your stream is encoded that causes this.
I suggest ruling out #1 by trying on a few different machines.
or, rule out #2 by trying the sample smooth SDK stream: http://mediadl.microsoft.com/mediadl/iisnet/smoothmedia/Experience/BigBuckBunny_720p.ism/Manifest

Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'

I'm using Sap Jco to connect to SAP database with the front end being Java(JSF), When I connect to SAP with:
try {
mConnection =JCO.createClient("400", // SAP client
"c3026902", // userid
"********", // password
"EN", // language
"iwdf5020", // host name
"00"); // system number
mConnection.connect();
}
catch (Exception ex) {
ex.printStackTrace();
System.exit(1);
}
Problem I'm facing is when run the application for the first time, data is displayed but when I re-run it says "Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC' "
Can any one help me in resolving the issue?????
This sounds like the API cannot load the native driver files.
The SAP Java Connector consists of a native runtime part, that does the actuall communication and a Java API that wraps this functionality with a java api.
The Java API is inside the sapjco.jar and the native drivers are e.g on windows inside librfc32.dll and sapjcorfc.dll.
Place these dll's into your system path (e.g. windows: C:\WiNDOWS\system32) and it should run.
Cheers
Sebastian
Are your DLLs located in the Windows system32 folder? If so, are you probably using the wrong architecture? (x64 DLL on 32 bit or vice versa)
Also, are the DLLs the same version as the java api? If you have SAP GUI installed there could be older DLLs around.
Defining SAP connection:
For the Version 3,0 of the sapjco library there exists plenty of useful information. To create a connection following the instructions in:
http://www.browseye.com/linkShare.html?url=http://help.sap.com/saphelp_nwpi711/helpdata/en/46/fb807cc7b46c30e10000000a1553f7/content.htm?bwsCriterion=%22Setting%20Up%20Connection%22&bwsMatch=1&bwsCriterion=%22Setting%20Up%20Connection%22&bwsMatch=1
There are a few thing that you should take into account:
Place the dll file in the same place that the jar.
The dll must be the right version for your operating system and architecture otherwise you will get a native library error.
Example of code to create a connection to the server.
public class StepByStepClient
{
static String DESTINATION_NAME1 = "ABAP_AS_WITHOUT_POOL";
static String DESTINATION_NAME2 = "ABAP_AS_WITH_POOL";
static
{
Properties connectProperties = new Properties();
connectProperties.setProperty(DestinationDataProvider.JCO_ASHOST, "ls4065");
connectProperties.setProperty(DestinationDataProvider.JCO_SYSNR, "85");
connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, "800");
connectProperties.setProperty(DestinationDataProvider.JCO_USER, "homofarber");
connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, "laska");
connectProperties.setProperty(DestinationDataProvider.JCO_LANG, "en");
createDestinationDataFile(DESTINATION_NAME1, connectProperties);
connectProperties.setProperty(DestinationDataProvider.JCO_POOL_CAPACITY, "3");
connectProperties.setProperty(DestinationDataProvider.JCO_PEAK_LIMIT, "10");
createDestinationDataFile(DESTINATION_NAME2, connectProperties);
}
static void createDestinationDataFile(String destinationName, Properties connectProperties)
{
File destCfg = new File(destinationName+".jcoDestination");
try
{
FileOutputStream fos = new FileOutputStream(destCfg, false);
connectProperties.store(fos, "for tests only !");
fos.close();
}
catch (Exception e)
{
throw new RuntimeException("Unable to create the destination files", e);
}
}
public static void step1Connect() throws JCoException
{
JCoDestination destination = JCoDestinationManager.getDestination(DESTINATION_NAME1);
System.out.println("Attributes:");
System.out.println(destination.getAttributes());
System.out.println();
}
}
In SAPJco 3.0 connections are build from the info contained in a “Destination”.
The documentation example use a properties file to save the “Destination”. However it is a non-secure way to keep connection info. As is indicated on the documentation in the hightlighted paragraph you can see on next link.
http://help.sap.com/saphelp_nwpi711/helpdata/en/48/5fb9f9b523501ee10000000a421937/content.htm?bwsCriterion=%22In%20practice%20you%20should%20avoid%20this%20for%20security%20reasons.%22&bwsMatch=1
You can keep connection info on a database or any other storage system if you create a custom “DestinationDataProvider” In the Examples provided with the SAPJco library there is an example of how to create a custom DestinationDataProvider.

Troubleshooting "System property mbrola.base is undefined. Will not use MBROLA voices" when converting text to speech with JSAPI

I'm getting the following error:
System property "mbrola.base" is undefined. Will not use MBROLA voices.
import javax.speech.*;
import javax.speech.synthesis.*;
import java.util.Locale;
public class HelloWorld
{
public static void main(String args[])
{
try
{
// Create a synthesizer for English
Synthesizer synth = Central.createSynthesizer(
new SynthesizerModeDesc(Locale.ENGLISH));
// Get it ready to speak
synth.allocate();
synth.resume();
// Speak the “Hello world” string
synth.speakPlainText("Hello", null);
// Wait till speaking is done
synth.waitEngineState(Synthesizer.QUEUE_EMPTY);
// Clean up
synth.deallocate();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
For those who are still struggling with this one, here's how I got it to work on Windows in a plain notepad, no Eclipse involved.
I went to http://tcts.fpms.ac.be/synthesis/mbrola.html
and downloaded 2 packages under downloads of binary voices:
PC/Windows and PC/DOS
unzip it all and put PC/Windows binary in the same directory as PC/DOS executable mbrola.exe.
Please note mbrola.exe didn't work for me b/c it's 16-bit (go figure!), but i found this link:
http://sourceforge.net/projects/freetts/forums/forum/137669/topic/1219083
which had a zip file with 2 binaries, one from 2004 that appeared to work on my 64-bit Windows.
Then I downloaded the voices on mbrola website up above in section 1 I
wanted a female voice so I grabbed us1 and put the whole folder into the same directory as
PC/Windows binaries above and PC/DOS executable.
In the code i specified the following:
System.setProperty("mbrola.base", "C:\devsrc\main\Head-Rev\src\java\freetts-1.2\mbrola");
voice=vm.getVoice("mbrola_us1");
And I got my female voice. I didn't need any compile or runtime flags.
Hope this helps someone.
For me :
I downloaded Mbrola Tool
I downloaded Mbrola Base folder
Downloaded the required voice from Getting the MBROLA Voices section of Mbrola Site
Unziped the file from step 3 to the unziped directory got from step2 .
Set property "mbrola.base" by using : System.setProperty("mbrola.base", "E:\\xxx\\xxx\\mbrxxx");
Your code needs MBROLA app which is in the system. So you need to tell your application that MBROLA is here:
From command line or eclipse launch configuration: -Dmbrola.base=/location/to/mbrola OR
System.setProperty("mbrola.base", Morbola.class.getName()) and put the mbrola JAR is the classpath.
See this similar question
(You can use any one of the solution)
Works on Windows Systems for setting the mbrola.base:
- set environment variable "MBROLA_HOME" in the windows os
- use this code snippet to set the property mbrola.base
public class FreeTTSVoice {
private static String path = System.getenv("MBROLA_HOME");
// System.out.println(path);
public FreeTTSVoice(){
System.setProperty("mbrola.base", path);
listAllVoices();
}
public static void listAllVoices() {
System.out.println("All voices available:");
VoiceManager voiceManager = VoiceManager.getInstance();
Voice[] voices = voiceManager.getVoices();
for (int i = 0; i < voices.length; i++) {
System.out.println(" " + voices[i].getName()
+ " (" + voices[i].getDomain() + " domain)");
}
}
...
Because I used maven repository for mbrola instead of downloading it, I had to override this file in my java project: com.sun.speech.freetts -> internal_voices.txt and to add there:
# Uncomment to allow MBROLA voices:
de.dfki.lt.freetts.en.us.MbrolaVoiceDirectory
I am using ubuntu
If you are using windows you will required only step 1 and 2 .
Created a folder called mbrola
1. put downloaded mbrola-base for my operating system linux to it
2. put downloaded us1, us2, us3 extracted folders to this folder
3. Install the mbrola in ubuntu by command line.
sudo apt-get istall mbrola
After installation use this commad to check where your files has located
dpkg -L mbrola
Copied /usr/bin/mbrola file to the above mbrola folder
Update the program with the path to above program
System.setProperty("mbrola.base", "/home/ngs/INCUBATOR/egg-8/libries/MBROLA/mbrola");
Now it should work