Detector App freezes when starting FRAM while LMIC driver is in operation

 Issue by dniklaus
Thu Aug 30 10:32:10 2018
Originally opened as https://github.com/ERNICommunity/dust-measurement-network/issues/31

Actual Behavior
Adafruit FRAM I2C driver start renders the detector firmware application to be freezed while LMIC driver (LoRaWan RFM95 module driver) is in operation.
Expected Behaviour
The operation of all drivers must be possible w/o any interferencing issues.
Steps to reproduce

Run the Detector FW with the LMIC driver in service
Start I2C Bus (Wire.begin())
Heartbeat LED stops blinking, CLI on USB Serial shows no reaction

Possible Workarounds

for the MVP (2 detector nodes, we prepare 5 nodes), use a GPIO 3 bit wired device ID to distinguish between the devices, provice hard coded TTN Keys for all 5 nodes and provision the device's own tuple according to the GPIO 3 bit device ID, GPIO bits (#37):

Bit 0: Pin A0 (14)
Bit 1: Pin A1 (15)
Bit 2: Pin A3 (16)

try to use SPI instead of I2C bus, replace the Adafruit FRAM I2C by an Adafruit FRAM SPI
review the I2C HW, especially pull-up resistors (4k7), consider also other potential error sources as mentioned here: https://github.com/arduino/ArduinoCore-samd/issues/194#issuecomment-269444283

 Comment by dniklaus
Wed Nov  7 11:23:16 2018

@ithuerin have you already started working on this?

 Comment by dniklaus
Mon Jan 21 13:07:58 2019

@ithuerin The workaround (first point mentioned above) is implemented now (available in master branch).

Fix by #79a942e32aa79ed76d2de15ddf3c5feec7bf3870.

apply new LoRa configuration
restart LoRaWan Driver after accessing FRAM


Create more detailed feedback

I would like to be able to have the error message from a deployment failure to be included in the webhook message. It's pretty vague when every failure is reported as "Deployment status: rejected"
https://docs.microsoft.com/en-us/azure/devops/service-hooks/services/slack?view=azure-devops

@eal61 I checked with the product team, they recommend that you file a feature request to have this additional details included. You can file it by choosing Product feedback at the bottom of the article:

or you can file an issue directly at https://developercommunity.visualstudio.com/spaces/21/index.html
Thank you for your feedback.


Script updates

Use --skip-packager for storybook script
add testID to intro screen so detox tests pass
Fix app name in storybook.js
Yarn install with latest yarn

@cball : The testID I can get in. However, when trying to fix the app name in storybook.js. I can't seem to get the app name to import from app.json correctly.
I'm currently trying
AppRegistry.registerComponent(appName, () => StorybookUIHMRRoot); while importing {name as appName} from '../app.json'. The name in that file is what I've named the app, but it doesn't seem to transfer over. Is there a possibility that this value is set somewhere else in the timeline of generating the app?

Looks like this was fixed. Skip-packager is irrelevant now due to #11


Fixes ByteBuf Leak during Edge Cases of writeBodyTo

Description
Fixes #30666
Fixes a potential ByteBuf leak when using a non-buffered HttpResponse from NettyAsyncHttpClient. The leak should only occur if there is an error or cancellation while using writeBodyTo . This leak doesn't happen when using writeBodyToAsync as Reactor has built-in handling when the asynchronous stream errors or is cancelled where the synchronous writeBodyTo loses that capability as it leaves asynchronous stream.
All SDK Contribution checklist:

[x] The pull request does not introduce [breaking changes]
[x] CHANGELOG is updated for new features, bug fixes or other significant changes.
[x] I have read the contribution guidelines.

General Guidelines and Best Practices

[x] Title of the pull request is clear and informative.
[x] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

[x] Pull request includes test coverage for the included changes.

Hello @alzimmermsft ,Please let me know in which version of the SDK we can expect fix for this bug?

Hello @alzimmermsft ,Please let me know in which version of the SDK we can expect fix for this bug?

This will be included in the next release once this is merged, which should be some time later this week


feat: Add ledgerService interface

Signed-off-by: DaevMithran<EMAIL_ADDRESS>

Nice work @DaevMithran! Will help quite a bit with the modularisation.
One thing is that we cannot merge this into main as it contains breaking changes.
agentConfig now takes connectToLedgerOnStartup instead of connectToIndyLedgersOnStartup.
Could you make the PR against 0.3.0-pre? Then it will be included in the next release :).

Nice work @DaevMithran! Will help quite a bit with the modularisation.
One thing is that we cannot merge this into main as it contains breaking changes.
agentConfig now takes connectToLedgerOnStartup instead of connectToIndyLedgersOnStartup.
Could you make the PR against 0.3.0-pre? Then it will be included in the next release :).

Sure. I can see a lot of conflicts with this branch. I'll look into it, Thanks

Nice work @DaevMithran! Will help quite a bit with the modularisation.
One thing is that we cannot merge this into main as it contains breaking changes.
agentConfig now takes connectToLedgerOnStartup instead of connectToIndyLedgersOnStartup.
Could you make the PR against 0.3.0-pre? Then it will be included in the next release :).

Sure. I can see a lot of conflicts with this branch. Should we close this and create a separate pull request?

Yeah a new pull request is fine by me. Whatever is the easiest for you.


Leading Zero

Do a-picker capable of leading zero for 24H format (05:30 instead of 5:30)?

@sm2x - actually you are the second person asking for that. So yes, it will come in the next update soon.


DownloadImportFailureCsv File added BOM_UTF8 and unnecessary remove BOM_UTF8

Description
It removed the part that added BOM_UTF8 to subsequent CSV files, and consequently removed BOM_UTF8.
As long as there is BOM_UTF8 only at the beginning (header) of the final merged CSV file, the file opens without any encoding issues.
6e0ba25
Visual changes
none
Functional changes

[x] Code style has been fixed by running the composer cs command.
[x] Changes have been tested to not break existing functionality.
[x] Documentation is up-to-date.

I don't understand, sorry. Can you please check #12197?

I don't understand, sorry. Can you please check #12197?

updated description

Thanks


[dx12] Fill out max_framebuffer_layers and max_per_stage_resources

Helps with https://github.com/gfx-rs/portability/issues/242#issuecomment-771881593
PR checklist:

[ ] make succeeds (on *nix)
[ ] make reftests succeeds
[ ] tested examples with the following backends:

bors r+

bors r+


Fixed Tests and Updated to work with Cucumber 2.0

Fixed all the tests so that they pass. Changed the apickli-gherkin file in step_definitions to a require statement instead of a symlink. Changed the registerHandler methods to support cucumber.js 2.0 which no longer passes an event with a getPayloadItem method.

Thanks a lot for this @bialesdaniel. I was trying to spare some time to fix your original issue for the last couple of days.
I have just one problem: the tests that are failing for you are designed to be failed so that we can see the console outputs when tests fail. This is to assert that we see the correct error responses for failures.
If you see gulpfile, https://github.com/apickli/apickli/blob/master/source/Gulpfile.js#L5 is the task that most of us use to execute tests. The tests that should fail are implemented in a separate file and gulp task called console-test.
So is it possible to update this PR with console-output.js reverted back to its previous form please?

Ah very interesting! I can absolutely do that. Would you mind if I added a brief CONTRIBUTING.md file which explains that too in order to prevent other people from making the same mistake I did. Unless that information is somewhere else that I missed

I wouldn't mind at all :)

I made those updates. Let me know how they look.


[web] switch by runtimeType doesn't work for release build.

As mentioned in the title switch by runtimeType doesn't work for release build, but works fine for debug. Also it works fine on Android and iOS in both modes.
Steps to Reproduce
if you run this code in debug mode you'll get the red screen, but in release mode you'll get the black screen.
import 'package:flutter/material.dart';

void main() => runApp(app());

Widget app() {
  Switcher switcher = Red();

  switch (switcher.runtimeType) {
    case Red: return Container(color: Colors.red,);
    default: return Container(color: Colors.black,);
  }
}

abstract class Switcher {}

class Red implements Switcher {}

Target Platform: Web
Target OS version/browser: macOS 10.15.1 / Safari 13.03 /Chrome  77.0.3865.120
Logs
flutter doctor
[✓] Flutter (Channel dev, v1.10.14, on Mac OS X 10.15.1 19B77a, locale ru-RU)
    • Flutter version 1.10.14 at /Users/sunny/Library/Flutter
    • Framework revision 1946fc4da0 (13 days ago), 2019-10-07 15:23:31 -0700
    • Engine revision 1d62160fdb
    • Dart version 2.6.0 (build 2.6.0-dev.1.0 d6c6d12ebf)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/sunny/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • ANDROID_HOME = /Users/sunny/Library/Android/sdk
    • Java binary at: /Users/sunny/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/191.5900203/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.1, Build version 11A1027
    • CocoaPods version 1.8.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.5)
    • Android Studio at /Users/sunny/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/191.5900203/Android Studio.app/Contents
    • Flutter plugin version 40.2.2
    • Dart plugin version 191.8580
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[!] IntelliJ IDEA Ultimate Edition (version 2019.2.3)
    • IntelliJ at /Users/sunny/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

[✓] Connected device (2 available)
    • Chrome          • chrome          • web-javascript • Google Chrome 77.0.3865.120
    • Headless Server • headless-server • web-javascript • Flutter Tools

! Doctor found issues in 1 category.

/cc @vsmenon

@sigmundch

Thanks for filing the issue and the small example!
Turns out this is a well known limitation of the release dart2js compiler (https://github.com/dart-lang/sdk/issues/17207). We allow using type literals, but we don't canonicalize types so they are not available to be used in switch statements. At the moment, the best workaround for now is to use if-then-else instead of switch blocks.
The good news is that we are very close to fixing this. As part of the work to support NNBD we have made a large effort to change the runtime type representation. The new representation will support this use case. The new representation is not complete though, so it will be a little more time before we can close the bug.

@sigmundch - flutter is on the new rti now, right?

it's on by default everywhere, but it depends on which version of Dart is being used by flutter. This was enabled on Dart 2.8.0-dev.1.0 for the first time. Assuming flutter is using a later version (or master if we are autorolling), this issue should be now resolved.

I confirm that it works fine on the latest Flutter which I use.
flutter --version Flutter 1.14.6 • channel dev • https://github.com/flutter/flutter.git Framework • revision fabeb2a16f (8 days ago) • 2020-01-28 07:56:51 -0800 Engine • revision c4229bfbba Tools • Dart 2.8.0 (build 2.8.0-dev.5.0 fc3af737c7)

🎊 Yay! Closing as fixed then

Hi, I'm still having this issue with current master:
[✓] Flutter (Channel master, v1.15.4-pre.51, on Mac OS X 10.15.2 19C57, locale de-DE)
• Flutter version 1.15.4-pre.51 at /programming/flutter
• Framework revision dc636069fc (13 minutes ago), 2020-02-12 22:22:49 -0800
• Engine revision e0ebaea590
• Dart version 2.8.0 (build 2.8.0-dev.9.0 e4c39721c4)
@jonahwilliams: seems to be a dart issue. I also changed back to flutter beta, but the same

Could everyone who still has this problem please file a new issue with the exact descriptions what happens, logs and the output of 'flutter doctor -v'  please.
All system setups can be slightly different so it's always better to open new issues and reference related issues.

flutter build web
cd build/web/
firebase serve

nothing is shown...
but, debug build works.

This issue still happens on flutter web release on master channel
I tried: CrashReport.runtimeType.toString();
On web debug: CrashReport
On web release: minified:Dr

It looks like the dart2js minified the type name on release build
flutter doctor:
[✓] Flutter (Channel master, 1.22.0-2.0.pre.105, on Mac OS X 10.15.4 19E287, locale en-US)
    • Flutter version 1.22.0-2.0.pre.105 at /Users/root/Documents/Soft/flutter
    • Framework revision cad4d1333e (8 hours ago), 2020-08-27 17:48:05 -0700
    • Engine revision 77dd1c05b9
    • Dart version 2.10.0 (build 2.10.0-67.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/root/Library/Android/sdk
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /Users/root/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/root/Library/Android/sdk
    • Java binary at: /Applications/Android Studio 3.5
      Preview.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.6, Build version 11E708
    • CocoaPods version 1.8.4
[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio
    • Android Studio at /Applications/Android Studio 4.0 Preview.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[!] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio 3.5 Preview.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] VS Code (version 1.48.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.13.2
[✓] Connected device (3 available)
    • macOS (desktop)  • macos      • darwin-x64     • Mac OS X 10.15.4 19E287
    • Web Server (web) • web-server • web-javascript • Flutter Tools
    • Chrome (web)     • chrome     • web-javascript • Google Chrome 84.0.4147.135
! Doctor found issues in 2 categories.

@deisold - I'm sorry I missed your original post, @ductranit - thanks for following up
I know it's not the answer you were hoping for, but this is one behavior of .runtimeType that is by design.
The Dart language specification purposely allows the runtimeType.toString to be changed under different circumstances. The dart2js compiler changes it when minifying applications to remove all references to the original names, this helps both with code-size and with sensitive data (many teams find that the names used in their code are too sensitive if the app is not open source, and prefer to keep those private).
The main purpose for .runtimeType.toString is that when errors occur (e.g. exceptions are thrown), they may contain a runtime type in the error message. These errors can be logged to a server where you can use data in the source-map file to lookup the original name and triage a production failure. Beyond that, our general recommendation is that it should not be used for almost anything else: no control-flow logic (we recommend subtype is checks instead), no comparing it against expected names, no displaying it visibly on the UI. See also https://github.com/dart-lang/sdk/issues/35052#issuecomment-621644698 .
Sorry I don't have better news for you, but hopefully this additional context is helpful.

@sigmundch thank for your information, that makes sense. I'll try another way


[agentless-scanner] Install upstart and sysv init scripts

What does this PR do?
This change also installs the upstart and sysv init scripts, along with the systemd init scripts that were previously installed.
Motivation

Additional Notes

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

/merge


[Bug]: invalid request: agent message content is empty

Describe the bug
openai.BadRequestError: Error code: 400 - {'error': {'message': 'invalid request: agent message content is empty', 'type': 'invalid_request_error'}}
when i run the groupchat. First round is good, the second round appear the error.
Steps to reproduce
No response
Model Used
gpt-4
Expected Behavior
No response
Screenshots and logs
Traceback (most recent call last):
File "/Users/zhouql1978/dev/xplorer/xplorer-new-func.py", line 351, in
chat_results=user_proxy.initiate_chats(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 1183, in initiate_chats
self._finished_chats = initiate_chats(_chat_queue)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/chat.py", line 179, in initiate_chats
chat_res = sender.initiate_chat(**chat_info)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 987, in initiate_chat
self.send(msg2send, recipient, silent=silent)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 628, in send
recipient.receive(message, self, request_reply, silent)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 788, in receive
reply = self.generate_reply(messages=self.chat_messages[sender], sender=sender)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 1909, in generate_reply
final, reply = reply_func(self, messages=messages, sender=sender, config=reply_func_tuple["config"])
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/groupchat.py", line 620, in run_chat
reply = speaker.generate_reply(sender=self)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 1909, in generate_reply
final, reply = reply_func(self, messages=messages, sender=sender, config=reply_func_tuple["config"])
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 1275, in generate_oai_reply
extracted_response = self._generate_oai_reply_from_client(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 1294, in _generate_oai_reply_from_client
response = llm_client.create(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/oai/client.py", line 626, in create
response = client.create(params)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/oai/client.py", line 279, in create
response = completions.create(**params)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/openai/_utils/_utils.py", line 275, in wrapper
return func(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/openai/resources/chat/completions.py", line 667, in create
return self._post(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/openai/_base_client.py", line 1208, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/openai/_base_client.py", line 897, in request
return self._request(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/openai/_base_client.py", line 988, in _request
raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'error': {'message': 'invalid request: agent message content is empty', 'type': 'invalid_request_error'}}
Additional Information
No response

Can you please provide a repro of the issue


Small changes to support SSE event-stream

From https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
Must admit, first I have ever heard of this !
This is a dead simple protocol that allows a normal GET endpoint to persist, and be used to push messages from the server to the client over a standard HTTP/1 connection. Good browser support (ALL), and polyfills do exist for older browsers to use the API as well.
To get http.zig working with this, just needs to set the .ContentType to "text/event-stream"
AND .. not send the content-length, otherwise the client closes the connection.
AND ... not use chunked encoding.
Then the handler just sits in a loop, and produces message frames on demand.  Since we are running handlers in threads, this makes it trivial to use std.Thread.Condition to signal / broadcast event-stream handlers to do updates as soon as some state changes.  Proper realtime updates over HTTP, no need for websockets !
You can see some small changes I made in the "event-source" branch on my fork to get it all working.
https://github.com/zigster64/http.zig/tree/event-source
Main points :

added a .EVENTS content type
fixed 1 test case that looks at content-type vs file extension name
added a helper function res.useEventStream() to setup the headers correctly
added some logic in res.write() to NOT send a 0 content-length if its an event-stream and the body is empty
added an assert in res.write() to check that the content type is not .EVENTS if the body is not empty

Currently hacking with a demo app that uses event-streams to do realtime updates. It's a very cool API, really easy to apply.
https://github.com/zigster64/zchat
Here is what an event-stream handler using http.zig looks like
https://github.com/zigster64/zchat/blob/main/src/state.zig#L80-112
PS - had to do a number of other changes to get inline with latest zig, but I see you have been doing the exact same changes in yours at the same time !    I used zig fmt to auto fix my fork to be inline with the latest zig, but that has made some radical changes to the spacing compared to your master ... so Im reluctant to simply create a PR based on my fork yet.  Dunno - is it worth the effort to sync formatting an create a PR do you think ?

Thanks, I implemented the logic.
It's mostly the same as what you did, but I opted for res.startEventStream() to (a) internally call "write" and (b) return res.stream:
const stream = res.startEventStream();
// no need to call res.write()

While the returned stream is just res.stream, I think this API better illustrates that res should not be used after startEvenStream() is called.

Nice work, that saves some potential footguns.
will port zchat to use master, and try and sort out what’s up with my formatting diffs too.
next up, I’m going to look at jet’s over the next couple of weeks.


[PopperUnstyled] Fix Tooltip Anchor Element Setter

[x] I have followed (at least) the PR section of the contributing guide.

Problem
When props.anchorEl is a function, it sometimes gets called with one argument when it expects no arguments (see codesandbox example).
Cause
This is happening because the state setter setTooltipAnchorEl(anchorEl) (recently added in #34714) calls a function anchorEl as if it were in the form of setTooltipAnchorEl((prev) => next).
Solution
We should call resolveAnchorEl on anchorEl before setting tooltipAnchorEl.

@mnajdova @michaldudak this is ready for review when you get a chance! Thanks!

LGTM @michaldudak Can you take a final look?

Looks good! I do have one remark about naming, but apart from that it's good to go.