Specify To Directory

I'm calling mix.imagemin inside a loop and I'd like to be able to specify a directory to output the processed file to like so:
mix.imagemin(
        'picks/*.jpg',
        {
            to: `public/assets/images/picks/${type.folder}/`,
            context: 'resources/assets/images/',
        }
);

This isn't working - the files are processed but put in a top level folder called picks in public...

The second parameter are of mix.imagemin() is passed as the options parameter for the copy-webpack-plugin. If you look at the documentation for that plugin, you'll see that the options parameter doesn't support the to key. You should be using the first parameter, which is passed to the patterns parameter of the copy-webpack-plugin.
The code below should work, but I haven't tested this.
mix.imagemin(
    {
        from: 'picks/*.jpg',
        to: `public/assets/images/picks/${type.folder}/`,
    },
    {
        context: 'resources/assets/images/',
    },
);

Thanks for replying.
I have changed my arguments to the following:
mix.imagemin(
        {
            context: 'resources/assets/images/picks',
            from: '*.jpg',
            to: `assets/images/picks/${type.folder}/`,
        },
        {
            progressive: true,
            svgoPlugins: [{removeViewBox: false}],
            use: [pngquant],
        },
    );

which works but I'm confused as to why because the method in Imagemin.js has arguments like so:
register(patterns, copyOptions = {}, imageminOptions = {}) {}

Isn't the third argument meant to be for imageminOptions?
Also, currently this is inside a loop like so:
const imageTypes = [
    {folder: 't'},
    {folder: 'sq'},
    {folder: 'sql'},
    {folder: 's'},
    {folder: 'm'},
    {folder: 'l'},
];
imageTypes.forEach((type) => {

    mix.imagemin(
        {
            context: 'resources/assets/images/picks',
            from: '*.jpg',
            to: `assets/images/picks/${type.folder}/`,
        },
        {
            progressive: true,
            svgoPlugins: [{removeViewBox: false}],
            use: [pngquant],
        },
    );

});

but only the last directory in the array ('l') is created.

The first two arguments get passed directly to the two constructor arguments for the Copy Plugin, like so new CopyPlugin(patterns, copyOptions), while the third argument gets passed to the Imagemin Plugin, like so new ImageminPlugin(imageminOptions). Refer to the documentation of each of the plugins to see how exactly all of those can be used.
This also means that the code you've provided above is not passing the Imagemin options to the Imagemin Plugin. Additionally, you can also move the context option from patterns to copyOptions, given that it's shared for each pattern.
mix.imagemin(
    {
        from: '*.jpg',
        to: `assets/images/picks/${type.folder}/`,
    },
    {
        context: 'resources/assets/images/picks',
    },
    {
        progressive: true,
        svgoPlugins: [{removeViewBox: false}],
        use: [pngquant],
    },
);

As for why only the last directory is compiled, this is because the imagemin plugin gets re-registered every time in that loop and overwrites the previous call. This is a bug and I'll try to get that fixed asap.
However, you can prevent this by just passing all the patterns at once instead of calling mix.imagemin inside of a loop, like below.
const imageTypes = [
    {folder: 't'},
    {folder: 'sq'},
    {folder: 'sql'},
    {folder: 's'},
    {folder: 'm'},
    {folder: 'l'},
];
let patterns = [];
imageTypes.forEach((type) => {

    patterns.push({
        from: '*.jpg',
        to: `assets/images/picks/${type.folder}/`,
    });

});

mix.imagemin(
    patterns,
    {
        context: 'resources/assets/images/picks',
    },
    {
        progressive: true,
        svgoPlugins: [{removeViewBox: false}],
        use: [pngquant],
    },
);

Excellent! Thank you for explaining. I misunderstood the use of the patterns argument.
I'll get this implemented today and let you know if I run into any other issues. Cheers.

Sorry for using this issue for my question.
I adopted the proposal from @CupOfTea696 but i don't get, why it doesn't compressing the images.
Can somebody help me out here?
It looks like this:
require('laravel-mix-imagemin');

const imageFolders = [
    {folder: 'landingpage'},
    {folder: 'unterordner2'}
];

let patterns = [];
imageFolders.forEach((type) => {

    patterns.push({
        from: `${type.folder}/*.*`,
        to: `assets/images/`,
    });

});

mix.imagemin(
    patterns,
    {
        context: 'frontend/images',
    },
    {
        optipng: {
            optimizationLevel: 5
        },
        jpegtran: null,
        plugins: [
            require('imagemin-mozjpeg')({
                quality: 50,
                progressive: true,
            }),
        ],
    }
)


Removed duplicate section "Setup the .EDGERC File"

There appears to be a second, identical occurrence of the section named, "Setup the .EDGERC File". This change removes the second one.

Thanks for your contribution @pizza0rodeo  !!!
this is really appreciated ;)


Update cgmath to version 0.15 with mint support

Thank you for PR, @alteous
But I think it's not necessary. I'm working on #65 now, updating cgmath will be included.
I don't mind, just fyi.

agreed
bors r+


SuperOTC format for font-source-han-sans

[x] Commit message includes cask’s name (and new version, if applicable).
[ ] brew cask audit --download {{cask_file}} is error-free. [no name stanza]
[x] brew cask style --fix {{cask_file}} left no offenses.

See #519.

Please add the name stanza.

Done.

Thank you.


Blinky and button samples not working for Nucleo F411RE

Blinky and button samples not working for Nucleo F411RE
Successfully built the sample, without issues or errors, with:
west build -p always -b nucleo_f411re samples/basic/blinky

Programming the board directly with the binary file (.hex, .bin) via STM-32 LINK UTILITY does not work.
(west flash does not either, but that's for another issue)
However, using the blinky sample from Mbed IOS, compiling via Keil Studio Cloud and programming with the same method DOES work (ruling out faulty board, checking connection, etc)
Expected behavior
Samples working out of the box, given that it is a supported board
Environment (listing the two that I used):

WSL Ubuntu 22.04    -- Ubuntu 20.04
Zephyr SDK 0.16.3     -- 0.13.0
Zephyr 3.5.0rc2          -- 2.6.0

Additional context
I have successfully used Zephyr previously with a custom board, in another computer. Also tried building the binary with that environment (the second one listed, v2.6.0), with the same result
I also tried modifying the used gpios in the sample, to no avail.

This seems to be a pin conflict on the GPIO PA5

On my side, this sample works out of the box using default west flash.
I'm using Ubuntu 20.04, v3.5.0-rc2-56.
Please note that Programming the board directly with the binary file (.hex, .bin) via STM-32 LINK UTILITY does not work. is not the usual flashing process, even if I don't see why it wouldn't work.

@gabohc  can you please check your hardware board : SB12 (NRST) is not open (on the bottom side of the MB1136 nucleo_f411re board)

@FRASTM I can confirm, it is not open.
@erwango Yes, I know it's not the standard flashing, but I assumed it would be no problem since in the past I was able to manually flash the other board with the bin file via JTAG with a Raspberry Pi

@gabohc What's your board revision ?

Hi apologies for the late reply
I tested this once again, both by repeating the process in Windows and Linux, but same result


Sticky header broken at Series

What happened?
seems sticky navbar is sticky but not at previous locationthe
Please reproduce in steps
go to series insight
scroll down
observe
Expected Behavior
stay at origin place :)
What browsers are you seeing the problem on?
Chrome
Are you logged in?
Yes
At which address did you encounter bug?
beta.kodadot.xyz
Screenshots
https://user-images.githubusercontent.com/5887929/156382609-99b624b7-da42-42b9-aa03-3fa489877481.mov
Relevant log output
No response
Code of Conduct

[X] I agree to follow this project's Code of Conduct

@yangwao I'll check this

Seems this is back and broken :(

Ill check this

Ill check this

any progress on this?

Thought it was p3, now that its p2, I'll start working on this @yangwao


Platform dosnt init to Web when deployed to AWS

Describe the bug
Package dosnt initialize properly when deployed to AWS Static site.
When running localy on Web there are no issue but when deployed to AWS I receive this error
MissingPluginException(No implementation found for method authenticate on channel flutter_web_auth_2)
I resolved this issue by changing the default from windows to web but this probably isnt a good long term solutions
https://github.com/TheRealNOIG/flutter_web_auth_2/commit/633e2068c244347d641afd63216f9ca224e9012d
To Reproduce
Steps to reproduce the behavior:

Build Flutter App to web
upload to AWS Static Site (I use SST for this)
Have something call FlutterWebAuth2.authenticate
Look at console for error MissingPluginException(No implementation found for method authenticate on channel flutter_web_auth_2)

Expected behavior
Open 3rd party auth site
Screenshots
If applicable, add screenshots to help explain your problem.
Device (please complete the following information!)

Browser: Chrome, Firefox, Edge
flutter_web_auth_2 version: All version (tested from 2.2.1 to 3.0.2

Additional context
Add any other context about the problem here.
Checklist

[x] I have read and followed the entire troubleshooting guide and it has not provided the solution I need.
[X] I have provided all the information I can (incl. auth URL etc.)

I hope that this is now fixed in 3.0.3. Could you please try and report back?
Conditional exporting seems to not work very nicely in Flutter/Dart yet, so I am guessing that 31d59aca8e3b438fa9b8afb287e5baf6a1c6a4a7 should do the trick :)

That resolved it.
Thanks

Perfect, thanks for reporting back!


Serial Communication Improvements

Currently, serial communication between the Teensy boards is very slow (~8 Hz), likely due to the size of each packet.
Packets are encoded as strings, where each character in the string is a byte.
The current packet format is:
(T,SPEED,DAMPER)

where T is the type of data (1 byte), SPEED is the wheel speed (~4 bytes) and DAMPER is the damper travel (~4 bytes).
This results in a packet that is about 13 bytes in length.
One improvement that can be made is by redesigning the packet format to use less bytes per packet.
This could entail using arrays of uint8_t and bit shifting/masking.

Current solution:
it is possible to transfer SPEED and DAMPER with only one byte of data, besides the parentheses.
The first bit transmits the status of the wheel's magnet sensor. Only 0 or 1. Calculations to convert that to actual speed can be done later.
The remaining 7 bits transfer a percentage of the damper's maximum extension. We know the maximum extension to be around 2.5 inches, so this percentage of extension can be converted to inches later.
T can be eliminated as long as this is case is the only serial communication with one byte of data. The length of the communication can be used as an identifier.
Commas will be eliminated because only byte of information is passed.
Therefore, only three bytes will need to be passed: the two parentheses and the single speed/damper byte.


fix: wait for the next tick

according to https://vue-test-utils.vuejs.org/guides/#using-nexttick we have to wait for the next tick for this test to pass

I can add prettier to run auto on my commit lint branch.


build: push to Dockerhub and Quay

@sdurrheimer

You also need to duplicate the make dockerstep, if not, you're going to push nothing to quay.io.
    - |
      if [ -n "$CIRCLE_TAG" ]; then
        make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME DOCKER_IMAGE_TAG=$CIRCLE_TAG
        make docker DOCKER_IMAGE_NAME=$QUAY_IMAGE_NAME DOCKER_IMAGE_TAG=$CIRCLE_TAG
      else
        make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME
        make docker DOCKER_IMAGE_NAME=$QUAY_IMAGE_NAME
      fi

Done

👍


Add a new Azure.Core helper that returns version and projection Info

Create a new helper that returns appropriate version projections info for a service

interface ServiceVersion {
  version: string,
  getProjectedProgram(program: Program): ProjectedProgram;
}

export function buildServiceVersionProjections( program: Program, service: Service): ServiceVersion[];

This function should ensure that the `version

defer until after DPG discussion 1/18

No longer needed, as service.version is being deprecated


Use slug in URL

Can't two questions generate the same slug?

You are right, I forgot to implement this use case


Improve mouse support

While Nitro does currently have support for getting the current mouse position on screen this could be vastly improved upon.  Current wishlist:
Relative mouse mode
Mouse position within the game world

Mouse position within game world has been added.  I won't be working on adding relative mouse support anytime soon as my game just doesn't need it.  If you need it for yours though I'm happy to review your PR!

mouse_world_pos currently doesn't support camera rotation correctly.  This will need to be fixed, I will likely work on it tonight.

I'm no longer using this for my own game, (project needed to move faster than nitro could be done)
So I think I'm going to revisit relative mouse support.


Virtual text: cursor position incorrect when start_incl=1

Steps to reproduce
let thecode =<< END
void   _SetErrorCode(int errorCode);

int main()
{
  _SetErrorCode( 10 );
}
END

call prop_type_add( 'Parameter', #{ highlight: 'NonText', start_incl: 1 } )

call prop_add( 6, 18, #{ type: 'Parameter', text: 'errorCode: ' } )
call cursor( 6, 18 )

vim --clean -S test.vim test.vim
cw - change the 10 token
note the cursor position to the left of the virtual text errorCode:
type test (or anything else)
note cursor jumps to the right of the errorCode:

Note that I found this while trying to find a repro case investigating another issue that I'm really struggling to pin down. The issue is that when editing the last argument in a function where I have inlay hints added, screen drawing goes strange - just draws @ down the left side and doesn't draw any of the buffer below. Any ideas?!
Initial state:

After typing cw on the 10 token:

Expected behaviour
Cursor is to the right of the hint errorCode when changing the word
Cursor doesn't jump when entering text at that position.
Version of Vim
9.0.124
Environment
macOS intel
Logs and stack traces
No response

Ben Jackson wrote:

Steps to reproduce
let thecode =<< END
void   _SetErrorCode(int errorCode);

int main()
{
  _SetErrorCode( 10 );
}
END

call prop_type_add( 'Parameter', #{ highlight: 'NonText', start_incl: 1 } )
call prop_add( 6, 18, #{ type: 'Parameter', text: 'errorCode: ' } )

vim --clean -S test.vim test.vim
(note cursor position)

Where is it?

type test
(note cursor jumps)

What do you mean with "type test" ?

Note that I found this while trying to find a repro case investigating
another issue that I'm really struggling to pin down. The issue is
that when editing the last argument in a function where I have inlay
hints added, screen drawing goes strange - just draws @ down the
left side and doesn't draw any of the buffer below. Any ideas?!

I have just submitted a patch that adds padding for virtual text.  As
part of this the code has been refactored.  I might also solve this
problem.  Please try again.
--
Lose weight, NEVER Diet again with
The "Invisible Weight Loss Patch"
(spam e-mail)
/// Bram Moolenaar -- @.*** -- http://www.Moolenaar.net   \
///                                                                      \
\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

sorry I think the repro case I pasted was broken.

Where is it?

The cursor was positioned to the left of the virtual text (rather than the right) when doing cw on the 10 token.

What do you mean with "type test" ?

After cw, typing test (or anything else), the cursor jumped to the right of the virtual text.
That said, I can no longer reproduce this particular cursor positioning issue with the above minimal case.
However, I have found a perhaps related issue, this time the the text is inserted 1 character before the cursor position:
Steps:
let thecode =<< END
void   _SetErrorCode(int count, int errorCode);
int main()
{
  _SetErrorCode( 11, 10 );
}
END

call prop_type_add( 'Parameter', #{ highlight: 'Comment', start_incl: 1 } )
call prop_type_add( 'Pad', #{ highlight: 'NonText', start_incl: 1 } )

call prop_add( 5, 18, #{ type: 'Parameter', text: 'id:' } )
call prop_add( 5, 18, #{ type: 'Pad', text: '-' } )
call prop_add( 5, 22, #{ type: 'Parameter', text: 'errorCode:' } )
call prop_add( 5, 22, #{ type: 'Pad', text: '-' } )
call cursor( 5, 22 )

cursor should be on the 10 token
cw enter insert mode
cursor is just after the -
start typing (e.g. type test)
text is inserted 1 column before the cursor location

recording: https://asciinema.org/a/lseWYEn9auN1XcUIsySoHJjKU

I have just submitted a patch that adds padding for virtual text.  As
part of this the code has been refactored.  I might also solve this
problem.  Please try again.

I can still reproduce other draw problem with 9.0.249. Sorry I'm still trying to minimise a test case that doesn't involve installing a complex plugin. I commented out all of the plugin's autocmds and mappings and timers, and whatnot and it still happens, but I'm scratching my head as to how to minimise the case. I'll keep trying.

OK I have cracked it - the second problem is with cursorline - want me to open a separate issue?
Steps to repro:
let thecode =<< END
void   _SetErrorCode(int count, int errorCode);
int main()
{
  _SetErrorCode( 11, 10 );
}
END

set cursorline
call prop_type_add( 'Parameter', #{ highlight: 'Comment', start_incl: 1 } )
call prop_type_add( 'Pad', #{ highlight: 'NonText', start_incl: 1 } )

call prop_add( 5, 18, #{ type: 'Parameter', text: 'id:' } )
call prop_add( 5, 18, #{ type: 'Pad', text: '-' } )
call prop_add( 5, 22, #{ type: 'Parameter', text: 'errorCode:' } )
call prop_add( 5, 22, #{ type: 'Pad', text: '-' } )
call cursor( 5, 22 )

cursor should be on the 10 token
cw enter insert mode

See that the screen is drawn wrong from the current line to the end.
Recording: https://asciinema.org/a/M9zq08VKwLxaNjAZuuhUDIlGF

Ben Jackson wrote:

sorry I think the repro case I pasted was broken.

Where is it?

The cursor was positioned to the left of the virtual text (rather than
the right) when doing cw on the 10 token.

What do you mean with "type test" ?

After cw, typing test (or anything else), the cursor jumped to the
right of the virtual text.
That said, I can no longer reproduce this particular cursor
positioning issue with the above minimal case.
However, I have found a perhaps related issue, this time the the text
is inserted 1 character before the cursor position:
Steps:
let thecode =<< END
void   _SetErrorCode(int count, int errorCode);
int main()
{
  _SetErrorCode( 11, 10 );
}
END

call prop_type_add( 'Parameter', #{ highlight: 'Comment', start_incl: 1 } )
call prop_type_add( 'Pad', #{ highlight: 'NonText', start_incl: 1 } )

call prop_add( 5, 18, #{ type: 'Parameter', text: 'id:' } )
call prop_add( 5, 18, #{ type: 'Pad', text: '-' } )
call prop_add( 5, 22, #{ type: 'Parameter', text: 'errorCode:' } )
call prop_add( 5, 22, #{ type: 'Pad', text: '-' } )
call cursor( 5, 22 )

cursor should be on the 10 token
cw enter insert mode
cursor is just after the -
start typing (e.g. type test)
text is inserted 1 column before the cursor location

OK, I can reproduce this.  The cursor seems to be in the right place,
but the displayed text is wrong.  I'll look into it tomorrow.
A repro case is needed for things like this, not only to pinpoint the
problem but also to be able to add a regression test.  Adding a display
item like virtual text interferes with every other display item, it will
take a lot of trying out to locate and fix all the problems.
--
User:       I'm having problems with my text editor.
Help desk:  Which editor are you using?
User:       I don't know, but it's version VI (pronounced: 6).
Help desk:  Oh, then you should upgrade to version VIM (pronounced: 994).
/// Bram Moolenaar -- @.*** -- http://www.Moolenaar.net   \
///                                                                      \
\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

Thanks, confirmed this is working as expected.

Thanks, confirmed this is working as expected.

The problem with 'cursorline' is also fixed now?
If not, please open a new issue, so it's easier to track.
--
Shaw's Principle: Build a system that even a fool can use, and
only a fool will want to use it.
/// Bram Moolenaar -- @.*** -- http://www.Moolenaar.net   \
///                                                                      \
\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

The problem with 'cursorline' is also fixed now?

Yes it's also fixed.


Integrate additional shape files into API

This PR adds more polygons which need to be integrated into the API.
(More details TBD).

Deleting in favor of individual tickets for adding these.


make cyclonedds vender package play nice with colcon

Followup to #32.
Calling colcon_build builds all packages in the workspace, so we have to conditionally build cyclonedds within cyclonedds_vendor, not conditionally build cyclonedds_vendor.
Renamed the build option cyclonedds_vendor.

Why was cyclonedds_vendor introduced? What was wrong with building it separately as a plan CMake package?
If keeping the vendor package is indeed the direction in which we'd like to go, there must be follow-up PRs to both the repos file and the buildfarm config for the CycloneDDS-specific jobs, which were both working correctly before this change...

Additionally, the vendor package would need to provide a build-time dependency on git, which is not installed in the deb buildroot...

Why was cyclonedds_vendor introduced? What was wrong with building it separately as a plan CMake package?

Simply so that colcon could build cyclonedds if it is not installed. Either we need to add java and maven as build-time dependencies or we need to pass additional build flags to cyclonedds. The former requires manual steps, the latter requires wrapping the package in a colcon-aware wrapper.

@dirk-thomas or @nuclearsandwich, we'll have to deal with the cyclonedds deb that we've already introduced in Dashing. Have we done an 'obsoletetion' like this before? Or is the Deb still in the testing repo?

Before considering what to do with the existing debs let's first get a consistent proposal/ state on how to build CycloneDDS (see my previous comment https://github.com/atolab/rmw_cyclonedds/pull/32#issuecomment-531295015).
This patch as it is isn't feasible since it requires custom flags to be passed in order to build the vendor package: -DCYCLONEDDS_FROM_SOURCE=ON. The generic instructions as well as the CI integration don't work with package specific customization. This needs to build out of the box with no custom arguments.
So the option would need to be TRUE by default or it needs to check of CycloneDDS is already available and then skip the custom build. Another comment for this patch would be that the external repo should be cloned into the build space in order to not "pollute" the source space (also making the .gitignore file obsolete).
I am not sure what arguments favor to keep using the cyclonedds repo over doing this vendor package. But mentioning them somewhere why it was chosen might be a good idea.

I might be misunderstanding some of your feedback, so please clarify if I got anything wrong.

You have to choose which of the two options you want to do:
* clone `cyclonedds` into the workspace and build it as any other package or

* use a vendor package which by default builds CycloneDDS as an ExternalProject within

Based on your choice the existing instructions and Jenkins jobs might need to be updated.

This PR allows you to either install CycloneDDS externally or build it as a vendored package. If you do it as a vendored package, it passes some build flags which eliminate the need for Java and Maven.

The generic instructions as well as the CI integration don't work with package specific customization. This needs to build out of the box with no custom arguments.

This PR should build out of the box right now with no custom arguments. By default, this will find the cyclonedds build dependency.
https://github.com/rotu/rmw_cyclonedds/blob/e06c8dcb04b64ac9dc5a1af6f787baef81542b84/rmw_cyclonedds_cpp/package.xml#L15-L17

the external repo should be cloned into the build space in order to not "pollute" the source space

I disagree. It's source code, belongs in the src directory, and searching for e.g. an error message, should not require looking in a build folder. The alternative is to use a git submodule or subtree, but this way avoids checking out the repo if it's not needed for the build.

I am not sure what arguments favor to keep using the cyclonedds repo over doing this vendor package.

Using a single repo makes sense since you can make changes in unison and don't have to worry about version skew.

This PR allows you to either install CycloneDDS externally or build it as a vendored package.

This PR doesn't exist in a void space. There are instructions describing how a user should fetch / build CycloneDDS. There are .repos files which currently clone both repos. And there are CI jobs building CycloneDDS. All of these should follow a single way how CycloneDDS support for ROS 2 should be build.
What I am argueing for is to first come up with a description how you want the process to look like (probably one of the two options mentioned above). And then based on that decision we probably need a set of PRs to update the various places.

If you do it as a vendored package, it passes some build flags which eliminate the need for Java and Maven.

You can achieve the same in the cyclonedds repo by adding these flags to the colcon.pkg file.

I disagree. It's source code, belongs in the src directory, and searching for e.g. an error message, should not require looking in a build folder.

Since this is your repository the choice is up to you. The rational why every ROS 2 package places additionally fetched sources into the build directory is that you will get a clean build once you wipe the build directory. In your case that is not the case and will very likely let users run into problem when trying to update / rebuild a workspace. Therefore I would highly recommend to place the cloned workspace into the CMAKE_BINARY_DIR.

What I am argueing for is to first come up with a description how you want the process to look like (probably one of the two options mentioned above). And then based on that decision we probably need a set of PRs to update the various places.

I've clearly chosen the route of making it a vendored project so it can be easily built but turning it off by default so it will respect a system-wide install of CycloneDDS. What other various places need to be updated?

I've clearly chosen the route of making it a vendored project so it can be easily built but turning it off by default so it will respect a system-wide install of CycloneDDS.

If you want to recommend users to only clone and build this repository (and not need eclipse-cyclonedds/cyclonedds) then having the option by default be OFF won't work. And requiring the user to pass a custom flag isn't a viable option either if they don't have CycloneDDS installed. The default needs to work out of the box.
You can either flip the default to ON and not care about the installed CycloneDDS.
Or you could choose the default based on if CycloneDDS is installed (with the big downside that users will no notice that they might be using a different-than-intended version of CycloneDDS) - therefore I wouldn't recommend that.
Also just printing Using installed CycloneDDS. Nothing to do. and not even checking if CycloneDDS is actually installed isn't a good behavior either.

If you want to recommend users to only clone and build this repository (and not need eclipse-cyclonedds/cyclonedds) then having the option by default be OFF won't work.

True. I'm supporting both use cases. rosdep install --from src will install CycloneDDS. Setting the option to OFF skips building it in the workspace and falls back to the system-level build. Setting it to ON builds it as part of a workspace build, and uses that build in rmw_cyclonedds_cpp.
The big problem here is, and the reason I need a wrapper project that sometimes does very little, is that colcon build does not provide an option to persistently skip a particular package or dependency (correct if wrong). That is, rerunning colcon build and forgetting to skip the package will completely ignore the user's original intention and require manual mucking with the install path to undo. The only way to optionally build a package in a persistent way is either (1) the CMake cache (2) COLCON_IGNORE files (which also "pollutes" the source space).
Is there a better option I'm missing? What is this colcon.pkg file that you mentioned?

The big problem here is, and the reason I need a wrapper project that sometimes does very little, is that colcon build does not provide an option to persistently skip a particular package or dependency (correct if wrong).

colcon is not the source of your problem. For this matter you can consider just cloning the repos and calling cmake / make / make install on the packages in the right order (without any custom arguments). In the current state the user must clone CycloneDDS even though your intention is to embed it as an external project into this repo.
To proceed with the single repo idea I would recommend to get rid of the CycloneDDS repo in the instructions / .repos file / CI and change the default of the option in this repo to ON and by default build CycloneDDS in the build directory.
Whatever non-default options you like to offer for using CycloneDDS from somewhere else is something I don't mind (as long as you actually check that the available version satisfies your requirements, e.g. minimum version).

What is this colcon.pkg file that you mentioned?

https://colcon.readthedocs.io/en/released/user/configuration.html#colcon-pkg-files

colcon is not the source of your problem. For this matter you can consider just cloning the repos and calling cmake / make / make install on the packages in the right order (without any custom arguments).

Yes, but at least cmake -Dcyclonedds_vendor=OFF or -Dcyclonedds_vendor=ON will persist between builds in the CMake cache. If, on the other hand, you do colcon build --packages-skip cyclonedds_vendor, there is no memory of this choice and rerunning colcon build will build CycloneDDS and install it in the workspace install directory.
Toggling the behavior based on whether CMake detects CycloneDDS to be installed at build time is something I want to avoid. Build options should be specified, not guessed. You may want to test multiple build configurations on the same machine and you should never have to uninstall a package in order to get things to build in a certain way.

In the current state the user must clone CycloneDDS even though your intention is to embed it as an external project into this repo.

Why? The default, as I think I coded it, should be not to clone it by default and not to need to. What have I missed?

https://colcon.readthedocs.io/en/released/user/configuration.html#colcon-pkg-files

Okay. I was hoping this would allow for setting cmake flags from outside the cyclonedds source folder, but I guess it doesn't.
Thank you for your help, @dirk-thomas. I recognize you have strong feelings about getting this right, and I appreciate your input a ton!

In the current state the user must clone CycloneDDS even though your intention is to embed it as an external project into this repo.

Why? The default, as I think I coded it, should be not to clone it by default and not to need to. What have I missed?

If a user doesn't have CycloneDDS installed and your option to build it as an external project is disabled by default then obviously the user must have the CycloneDDS repo in the workspace and build it from there. Where else would it come from?

https://colcon.readthedocs.io/en/released/user/configuration.html#colcon-pkg-files

Okay. I was hoping this would allow for setting cmake flags from outside the cyclonedds source folder, but I guess it doesn't.

As the referenced documentation describes you can put any kind of command line option in a colcon.pkg file. So yes, you can place cmake-args into it too.

If a user doesn't have CycloneDDS installed and your option to build it as an external project is disabled by default then obviously the user must have the CycloneDDS repo in the workspace and build it from there. Where else would it come from?

rosdep install --from src -i

As the referenced documentation describes you can put any kind of command line option in a colcon.pkg file. So yes, you can place cmake-args into it too.

As per the link: "A colcon.pkg file must be placed in the root directory of a package." I'm looking to be able to configure the build CycloneDDS without editing anything within the CycloneDDS subtree. Maybe I misunderstood.

rosdep install --from src -i

How about on macOS or Windows were there is no binary package for CycloneDDS. Also the Debian package only exists because we bloomed the CycloneDDS repo. So technically it is pretty much the same as building that repo from source.

I'm looking to be able to configure the build CycloneDDS without editing anything within the CycloneDDS subtree.

The repository already has a colcon.pkg file: https://github.com/eclipse-cyclonedds/cyclonedds/blob/801c4b14566a15c08261818a1192b1d16d055d8e/colcon.pkg Why should it not contain that information?
colcon also offers mixins as well as a metadata repository. While both allow you to store such additional information out-of-source I don't think they are the right approach here.

Just wanted to say that I am simply silent because I don't know enough about these things to make a meaningful contribution, other than the things anyone would know already ...
I do think it may be worth mentioning that a number of people have told me that they really want Cyclone DDS to be easy to install/build/use with ROS2, and that they specifically mentioned not having to do anything themselves beyond downloading the RMW implementation — I presume this is about source builds — not even doing a separate download from Cyclone. It is a bit of mystery to me why it would be so, but I assume it is meant seriously. The second bit is that the Java dependency is seen as a problem.
@rotu's change solved those "issues" and that's why I liked a lot ... now, I obviously made the mistake of merging those changes too soon. I apologize for the inconvenience I caused you, @dirk-thomas and @cottsay, and will defer to you for any further changes in this.
From my perspective, it would be ideal if this repo simply went over to ros2.org and that the integration in the packaging and build system would be looked after by those who know what they are doing. I don't foresee large amounts of functional changes, so if that would be acceptable in principle, now(ish) might be a good time.
And with that, I go back to lurking and waiting until I have a clear statement that a PR is ready for merging!

I do think it may be worth mentioning that a number of people have told me that they really want Cyclone DDS to be easy to install/build/use with ROS2, and that they specifically mentioned not having to do anything themselves beyond downloading the RMW implementation — I presume this is about source builds — not even doing a separate download from Cyclone. It is a bit of mystery to me why it would be so, but I assume it is meant seriously.

The installation of Debian packages will always just be rmw_cyclonedds_cpp since it will bring its dependencies with it.
From source can either use a single repo (this one which uses ExternalProject to pull in CycloneDDS) or two repositories as defined in the existing .repos file. I don't see any different in either or if the single instruction to get the source is part of the instructions. Arguing to choose one over the other because of the difference of the single command needed to invoke seems absurd to me - especially with all the significant shortcomings of one of the two options.
E.g. there is a huge difference in usability between the two approaches. If you choose a single repo imagine the following use case:

user U clones the repo on date X
user U builds the workspace on date Y

first problem: what state of CycloneDDS is being used? The user has no way to give you that information when asking for support. The has of the cloned repo is meaningless.

user U notices later that something doesn't work and is being told in the support forums to use the latest state
user U git pull the repo

next problem: is CycloneDDS actually being re-fetched? Probably not.

user U wipes the build directory of the workspace to start fresh

and next: CycloneDDS is sitting in the source space and doesn't get fetch freshly

All of these problems just go away when you use both repos as is. The user can easy tell exactly which hash of CycloneDDS they have cloned AND built.
I could probably come up with more...
If you still want to use a single repo the following are imo must haves:

the ExternalProject must be used by default (as mentioned already multiple times)
the code should be placed and built in the build directory
the ExternalProject should use a specific hash of the CycloneDDS (like a git submodule for traceability) (this will make it much more difficult / effort to change to newer versions of CycloneDDS)

The second bit is that the Java dependency is seen as a problem.

If there is a CMake option to avoid using Java I think it should be set by default - either in the colcon.pkg file in CycloneDDS or in the ExternalProject` arguments.

From my perspective, it would be ideal if this repo simply went over to ros2.org and that the integration in the packaging and build system would be looked after by those who know what they are doing. I don't foresee large amounts of functional changes, so if that would be acceptable in principle, now(ish) might be a good time.

We are happy to move the repository to the ros2 org unit and all of you would keep unrestricted access to the moved repo. We are happy to help but the general maintenance role should stay with ADLINK though - independent of the location. If you want to proceed with the move please move it to my user name and I can move it from there to its destination.

@dirk-thomas

Arguing to choose one over the other because of the difference of the single command needed to invoke seems absurd to me - especially with all the significant shortcomings of one of the two options.

It is mystery to me, too ... I was willing to accommodate those absurdities since they appeared harmless enough to one not well-versed in dealing with tons of repositories. But you have convinced me otherwise :)
I think you're ok with the state of this PR as it is, correct? As far as I can tell it effectively reverts the "external repository" thing and cleans up the documentation a bit. I'm happy to merge it.

We are happy to move the repository to the ros2 org unit and all of you would keep unrestricted access to the moved repo. We are happy to help but the general maintenance role should stay with ADLINK though - independent of the location. If you want to proceed with the move please move it to my user name and I can move it from there to its destination.

Cool. It is a much better place for it than hidden away in some company-specific place ... Re the maintenance, I wouldn't want to suggest you take over, but this help you're already giving in ensuring it plays nicely with the rest is much appreciated.

I think you're ok with the state of this PR as it is

One of my comments is still pending - about the need to mention the CycloneDDS repo in the instructions.

I think you're ok with the state of this PR as it is

One of my comments is still pending - about the need to mention the CycloneDDS repo in the instructions.

Done.

Thank you - looking good to me!

Thanks @rotu and @dirk-thomas !


p11-kit: 0.23.19 -> 0.23.20

Motivation for this change
Small bug fix release. Fixes a bunch of flatpak issues (eg. no playback
on spotify): https://github.com/p11-glue/p11-kit/issues/275
news: https://github.com/p11-glue/p11-kit/releases/tag/0.23.20
Things done

[x] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
Built on platform(s)

[x] NixOS
[ ] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Ensured that relevant documentation is up to date
[ ] Fits CONTRIBUTING.md.

For reference, this bug also impact online features of the flatpak version of steam, see https://github.com/flathub/com.valvesoftware.Steam/issues/526

[0222/110531.254631:ERROR:cert_verify_proc_nss.cc(969)] CERT_PKIXVerifyCert for store.steampowered.com failed err=-8179
[0222/110531.255073:ERROR:ssl_client_socket_impl.cc(941)] handshake failed; returned -1, SSL error code 1, net_error -202

Lets get it into the next staging-next :)

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/flatpak-error-the-name-org-freedesktop-accounts-was-not-provided-by-any-service-file/6000/10

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/flatpak-error-the-name-org-freedesktop-accounts-was-not-provided-by-any-service-file/6000/12

When we can expect this fix in 20.03? Because I still have this problem in 20.03.

Hmm, looking at the git logs, it should have landed in 20.03 already.

I am have this channel: nixos https://nixos.org/channels/nixos-20.03 and still problem with Flatpak Steam. Should I open issue?
Error from Steam:

[0312/061900.469555:ERROR:ssl_client_socket_impl.cc(935)] handshake failed; returned -1, SSL error code 1, net_error -202

Right, according to the git log you should have the p11-kit update. So that's a bit strange. Might be worth checking out upstreams (p11-kit and flatpak) issue tracker and see if it's still an issue.

I opened bug report: https://github.com/NixOS/nixpkgs/issues/82422


Not using the ChatGPT API

Nice work, and useful to have GPT-3 access directly in Slack. And cool to see the Slack next-gen platform in action... and Deno too!
One clarification you might want to mention in your README... this isn't using ChatGPT, which doesn't have a released official API yet.
This is using the completions endpoint, which is fine for zero-shot scenarios, but it isn't stateful or conversational (not maintaining a conversation_id/parent_id that ChatGPT uses, for example).
This also uses the text-davinci-003 model, which is part of the GPT-3.5 series like the ChatGPT model, but they are distinct.
Though some folks have reverse-engineered the ChatGPT API and have released libraries to access the unofficial API until the official one is available:
Node:
https://github.com/transitive-bullshit/chatgpt-api
Python:
https://github.com/acheong08/ChatGPT
https://github.com/rawandahmad698/PyChatGPT

Hey there! Appreciate the clarification. I'll add a note this uses the GPT-3.5 API (but lacks iteration cycles that's useful in the magic in ChatGPT).
The session-based ChatGPT packages have browser-based workarounds that are still unsupported by the official API thus far.
I'd like to build threads for iteration once the API is supported in OpenAI. A natural extension of SlackGPT would be using threads to keep / pass state back to OpenAI's future ChatGPT.

A message thread would be a great fit to manage an ongoing ChatGPT session, good idea! And I suppose you could maintain the conversation_id/parent_id state either in the metadata for the messages and responses, or maybe somehow in the thread itself if that allows for custom metadata fields.

Hey @protodave! I had a chance this morning to update and implement the tool against OpenAI's new Chat Completions API.
Building threading could be useful if there's interest!

Building threading could be useful if there's interest!

That would be awesome. To predict it should also only use the input from this thread. This could also improve the quality.


Add clarification comments

resolve #5
Just adding better clarifcation comments, really nice implementation of the dracula theme.
Nyxt version 3 code looks really cool btw, it'll be a pleasure to play with.

Thank you.


@objc directive does not work on swift extension

I have a mixed framework where a Objective-C class is extended in swift(@objc) but the Objective-C class does not have visibility to the method. I'm getting error: no visible @interface for 'Objective-C Class' declares the selector 'myMethod'.
I'm using the apple_framework rule.
Any help will be welcome.

Can you point to a repo that reproduces the issue? Thanks!

I made this PR which probably does not reflect your issue but maybe similar? Also I feel they have the same root cause

Just want to give you guys some update on this one and how I solved the issue.
#import <Foundation/Foundation.h>

@interface MixedClass : NSObject

-(void)run;

@end

#import "MixedClass.h"
#import <MixedFramework/MixedFramework-Swift.h>

@implementation MixedClass

-(void) run {
	[self runSwift];
}

@end

Swift Extension
extension MixedClass {
	@objc
	func runSwift(){}
}

I was getting no visible @interface for 'MixedClass' declares the selector 'runSwift'
It turned out that making the Swift extension public (extension MixedClass -> public extension MixedClass`) solves the problem.

@edias I am running into the same issue, but this is more an issue that XCode is able to expose those internal symbols to the generated Swift Bridging code while we must be more explicit with Bazel by making these extensions public. I believe there are some flags you can pass to Xcode to emit these symbols even if they are not public, but I found that had its own share of issues (thread here)
If I were you I would just make what you need exposed public, that seems to be the consensus from others who have run into this issue


firebase deploy

TL;DR
I'm working on a new Firebase project and I'm using GitHub action to deploy my Firebase function I got the new message Authenticating with --token is deprecated and will be removed in a future major version of firebase-tools. I have tried to use your auth to solve the problem but I can't find any document related to Firebase deployment. here is my code it works but I still use the --token arg
name: Deploy to Google
on:
  push:
    branches: [ main ]
env:
  PROJECT_ID: xxx"
jobs:
  build:
    runs-on: ubuntu-latest
    env:
      working-directory: ./
    strategy:
      matrix:
        node-version: [18.x]
    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - name: install libraries
      run: npm install
      working-directory: ${{env.working-directory}}
    - id: 'auth'
      name: 'Authenticate to Google Cloud'
      uses: 'google-github-actions/auth@v1'
      with:
        token_format: 'access_token'
        credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
    - name: install firebase
      run: npm i firebase-tools -g
    - name: deploy
      run: |-
        firebase deploy --token $(echo '${{ steps.auth.outputs.access_token }}')

is there any way to remove the --token
Detailed design
No response
Additional information
No response

Hi @Anasmohana84 - this would be a better question for the firebase-cli team. You can open an issue on this repo: https://github.com/firebase/firebase-admin-node
Note that firebase does not support WIF yet (https://github.com/firebase/firebase-admin-node/issues/1377).


Cleaning up locale files. Enforcing consistency.

Part of https://github.com/24pullrequests/24pullrequests/issues/2125

:en locale is sorted, but structure/content is unchanged
all other locales are mirrored. missing keys are added, keys not present in :en are removed
added i18n test that will fail if locales are out of sync

Now it should be way easier to do structural refactoring in the future. Changing something on line 123 will have same exact key on line 123 in all locale files.
i18n-tasks can be probably removed now. Adding config.action_view.raise_on_missing_translations = true in dev/test environments should be enough.
I'd merge this PR before other changes to locale files happen. It's really hard to resolve conflicts.
Cheers

Anything that needs to be done to get this merged in?

Vous parlez tous en anglais,,et jcomprend pas trop votre principe
Télécharger Outlook for Androidhttps://aka.ms/ghei36

From: Oleg<EMAIL_ADDRESS>Sent: Monday, December 18, 2017 1:52:59 PM
To: 24pullrequests/24pullrequests
Cc: Subscribed
Subject: Re: [24pullrequests/24pullrequests] Cleaning up locale files. Enforcing consistency. (#2162)
Anything that needs to be done to get this merged in?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2F24pullrequests%2F24pullrequests%2Fpull%2F2162%23issuecomment-352523119&data=02|01||f93f82da14604202bde008d546488fc8|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636492199812279592&sdata=%2BoWNc1gu3Sz8hKeewd76fPcDtZ4Mv%2B2UXW83ZcESbHQ%3D&reserved=0, or mute the threadhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAeinkZrGow3-GhnpuV1ntPfnf4DIAGGYks5tBrSLgaJpZM4RBKiu&data=02|01||f93f82da14604202bde008d546488fc8|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636492199812279592&sdata=BR1az3VXV5ZWWQKYT9V%2FsWKqzPO8z56ekoNrj4IcGls%3D&reserved=0.

Jcomprend pas top l'anglais ni votre principe de code.jao telkent à faire...
Télécharger Outlook for Androidhttps://aka.ms/ghei36

From: Oleg<EMAIL_ADDRESS>Sent: Monday, December 18, 2017 1:52:59 PM
To: 24pullrequests/24pullrequests
Cc: Subscribed
Subject: Re: [24pullrequests/24pullrequests] Cleaning up locale files. Enforcing consistency. (#2162)
Anything that needs to be done to get this merged in?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2F24pullrequests%2F24pullrequests%2Fpull%2F2162%23issuecomment-352523119&data=02|01||f93f82da14604202bde008d546488fc8|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636492199812279592&sdata=%2BoWNc1gu3Sz8hKeewd76fPcDtZ4Mv%2B2UXW83ZcESbHQ%3D&reserved=0, or mute the threadhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAeinkZrGow3-GhnpuV1ntPfnf4DIAGGYks5tBrSLgaJpZM4RBKiu&data=02|01||f93f82da14604202bde008d546488fc8|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636492199812279592&sdata=BR1az3VXV5ZWWQKYT9V%2FsWKqzPO8z56ekoNrj4IcGls%3D&reserved=0.

👍 thanks for tackling this, very helpful going forward!

Part of #2125

:en locale is sorted, but structure/content is unchanged
all other locales are mirrored. missing keys are added, keys not present in :en are removed
added i18n test that will fail if locales are out of sync

Now it should be way easier to do structural refactoring in the future. Changing something on line 123 will have same exact key on line 123 in all locale files.
i18n-tasks can be probably removed now. Adding config.action_view.raise_on_missing_translations = true in dev/test environments should be enough.
I'd merge this PR before other changes to locale files happen. It's really hard to resolve conflicts.
Cheers


Feature/517 API calls thorough umbrella proxy - closes #517

@apinf/developers Please review. #517 related.
The approach is

Read the text file when selected.
Convert text data to JSON object to be able to refer to its values by key.
Modify values of host and basePath to what we need.
Convert object back to JSON string.
Construct new File( ) using updated file data. (This is implemented in two steps: First constructing new Blob( ). Second: new File( ) that takes Blob as parameter)
Saving file in Mongodb collection

Issues

Currently custom values of basePath and host are hardcoded. Since all the above process is happening on a client-side, there is no way to access Meteor.settings data.

Testing

Create new apiBackend. While this process, upload new documentation file e.g swagger.json. (For example default one: http://petstore.swagger.io/v2/swagger.json)
Go to documentation viewer page.
In drop down manu select uploaded file.
iFrame will give an error since the remote swagger UI was not able to access local file.
The path to documentation file is provided in there.
Copy this path to a new tab to see updated host and basePath values.

@frenchbread Is this still work in progress or should the PR be assigned?

@bajiat Yes, this it is still in progress.

Currently getting an error when running meteor:
Error: Invalid characters. Only 0-9 characters are allowed.

@apinf/developers any ideas?

This comes from the syncApiBackends server method.
Basically, an API Backend was entered directly in API Umbrella with zero for the port number. When our system tries to import that backend, port zero doesn't pass our validation (which looks for a port with two to five numeric characters). We (@elnzv) are going to remove the API Backend from API Umbrella and loosen up our RegEx validation.
You can take any temporary measures to continue working on this task, including commenting out the line with the db insert.

@brylie Having trouble to fetch a file on route callback:
JsonRoutes.add("get", "cfs/files/apiDocumentation/:id/:file", function (req, res, next) {

  var id = req.params.id;

  var b = [];

  var doc = ApiDocumentation.findOne({_id: id});

  var readStream = doc.createReadStream();

  var buffer = new Buffer(0);

  readStream.on('readable', function() {
    buffer = Buffer.concat([buffer, readStream.read()]);
  });

  readStream.on('end', function() {
    console.log(buffer.toString('base64'));
    b.push(buffer.toString('base64'));
  });

  JsonRoutes.sendResult(res, 200, b );
});

Found a solution to read binary data of file stored in db with collectionFS here. Though this solution did not work for me. Any suggestions how to read file from CollectionFS on a server-side?

After hours of debugging and reading tones of docs turned out that for some reason doc.createReadStream() come as undefined..

After updating cfs:* packages .createReadStream() is available.
Still not able to read the file.

Make sure your JsonRoute code is running on the server. Also, console log doc to make sure it is a FS object.

It is an FS object. Double checked that. And also JsonRoute on the server side. I am able to log anything to server console but file. It comes as an empty string.

Damir, one more idea. Store the API doc in a regular mongo collection, like you were thinking previously. I.e. parse the Swagger into an object and insert it into the collection (no schema necessary).
Then, in your JsonRoute you just return a db cursor (Collection.find(id)) or JS object (fetch ())-- exactly like the example code.

It is not essential to keep the Swahher file. We just need to preserve the original Swagger object structure.
We can then override the baseUrl on the fly like we are trying.

So basically we potentially can get rid of FS and store the actual Swagger object in the mongo collection.
Then, in JsonRoute, fetch the file, modify it & return. Correct?

Jep. Make sure to create a 'foreign key' field, such as apiBackendId, when storing the swagger document in the ApiDocs collection (or some similar name).

Ok. Thanks!

Huh.
Changes are pushed. Seems like everything works as expected now with clear code implementation and logic. Bonus check for protocol in base_url added. :smile:
ToDo:

Store foreign key for ApiDoc in ApiBackend document. (Issue: Since templates are different for documentation file upload & apiBackend submit, probably have to wait until related issue about redesigning addApiBackend page is implemented)
Provide ApiDoc url to Select box at viewApiBackend page.

@brylie @elnzv @bajiat

Make sure to use camel case now:baseUrl instead of base_url. This has changed recently.

Please review.
Good suggestion about  the URI.js library!

Please review.

@brylie About trailing slash:
If leave trailing slash, it will stack with remaining path that comes from swagger UI so it will be like: http://host.com/basePath//some_queries...
If I'll remove trailing slash from setting.json, meteor-api-umbrella package will argue.

@brylie if doing new URI(...), it will return same url with trailing slash present..

I made a small change to the file, as discussed earlier.
// Get basePath for apiUmbrella from Meteor settings file
  var baseUrl = new URI(Meteor.settings.apiUmbrella.baseUrl);

// Fetch the ApiDoc ...

// Updates values to custom ones
  ApiDoc.host = baseUrl.hostname();
  ApiDoc.basePath = baseUrl.path();

When generating a swagger.json based on the Meteor.settings.apiUmbrella.baseURl, the output from the JsonRoute has a structure like this:
...
  "host": "umbrella.apinf.io",
  "basePath": "/api-umbrella/",
...

Note the trailing slash in basePath. If this proves to be problematic, we can open a bug report.

I will refactor the API Umbrella integration module so that it doesn't use trailing slash.

I just reviewed the URI.js docs and found out there is a directory() method that works here. I have pushed a quick change. Please test @frenchbread
If this works, we can go ahead and merge the changes, otherwise we will revert to your working version and merge :-)

@brylie Tested and it works, but now, if trailing slash will not be provided, then basePath is equal to / :
var str = new URI('https://sample.com/pathname/'); // with trailing slash
str.directory(); // prints '/pathname'

var str = new URI('https://sample.com/pathname/'); // without trailing slash
str.directory(); // prints '/'

Right. This is tricky. OK, I'll revert my commits and merge.


IFUS y211ga crashing with 0.2.6

Hi @roleoroleo !
Just updated my IFUS y211ga camera and noticed that unlike firmware 0.2.4, my camera has trouble getting started. It reboots several times before becoming reachable.  When it doesn't, I cannot get an HTTP/SSH connection, just the ping works. I have to manually unplug/plug it until before perhaps it becomes reachable.
I don't see any log but maybe there's an additional flag to set somewhere ?
FYI, my other y21ga/h30ga work fine, so maybe related to y211ga only ?
I'd be glad to help if needed !
Thanks

Snapshot for recorded video and force low resolution snapshot are already disabled
maybe the same issue as #596

The main Yi process (rmm) doesn't start.
I have to check the boot script.

Please, try to rename the binary set_tz_offset to set_tz_offset.bak and restart the cam.
In /tmp/sd/yi-hack/bin

At a first I thought it fixed the issue, but after a minute or so, the camera rebooted by itself and again, only telnet is available.
hack_debug.log is pretty much the same as above.

The behaviour reported by @aqwserf is very similar to what I saw when I booted my camera with the new update, or when it crashes. #596

Could you test if the cam works with cloud enabled.
Maybe cloudAPI_fake is the problem.

On my side, it didn't change anything and it's even worst: the camera is in a boot loop until I change the settings.
Moving forward I changed the system.sh to get more log. Here it is after 3 reboot by itself and still only telnet connection:
root@camera-3:~# cat /tmp/sd/hack_debug.log
########
1970-01-01-00:05:53
Starting system.sh
Make /etc writable
Setting username and password
Configuring cloudAPI
Starting yi processes
[PS]
  PID USER       VSZ STAT COMMAND
    1 root       980 S    /sbin/init
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    4 root         0 SW   [kworker/0:0]
    5 root         0 SW<  [kworker/0:0H]
    6 root         0 SW   [kworker/u2:0]
    7 root         0 SW   [rcu_preempt]
    8 root         0 SW   [rcu_sched]
    9 root         0 SW   [rcu_bh]
   10 root         0 SW<  [lru-add-drain]
   11 root         0 SW   [kdevtmpfs]
   12 root         0 SW   [kworker/u2:1]
  210 root         0 SW   [oom_reaper]
  211 root         0 SW<  [writeback]
  213 root         0 SW   [kcompactd0]
  214 root         0 SW<  [crypto]
  215 root         0 SW<  [bioset]
  217 root         0 SW<  [kblockd]
  258 root         0 SW   [sys_user]
  265 root         0 SW   [kworker/0:1]
  266 root         0 SW<  [cfg80211]
  273 root         0 SW<  [watchdogd]
  287 root         0 SW<  [spi0]
  297 root         0 SW   [kswapd0]
  380 root         0 SW<  [bioset]
  385 root         0 SW<  [bioset]
  390 root         0 SW<  [bioset]
  395 root         0 SW<  [bioset]
  400 root         0 SW<  [bioset]
  405 root         0 SW<  [bioset]
  410 root         0 SW<  [bioset]
  415 root         0 SW<  [bioset]
  420 root         0 SW<  [bioset]
  448 root         0 SW   [kworker/0:2]
  449 root         0 SW   [irq/302-sunxi-m]
  451 root         0 SW   [irq/166-sdc0 cd]
  452 root         0 SW   [irq/303-sunxi-m]
  495 root         0 SW   [kworker/0:3]
  518 root         0 SW   [kworker/0:4]
  520 root         0 SW<  [bioset]
  521 root         0 SW   [mmcqd/0]
  532 root         0 SW<  [kworker/0:1H]
  545 root         0 SWN  [jffs2_gcd_mtd4]
  550 root       980 S    -/bin/sh
  583 root       980 S    /usr/sbin/telnetd
  596 root         0 SW<  [phy0-atbm_wq]
  597 root         0 SW   [phy0-usb_atbm_b]
  641 root       812 D    ./dispatch
  644 root       988 S    sh /tmp/sd/yi-hack/script/system.sh
 1203 root       980 R    ps
[FREE]
              total        used        free      shared  buff/cache   available
Mem:          60912        9208       46088          68        5616       50600
Swap:             0           0           0

Changing /etc/hosts
Starting blacklist
Touch RTSP
Touch Speaker
Starting rmm
Sleep 6
dd audio_fifo 8192
Start buffer
Start cloud
Yi processes started successfully
[PS]
  PID USER       VSZ STAT COMMAND
    1 root       980 S    /sbin/init
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    4 root         0 SW   [kworker/0:0]
    5 root         0 SW<  [kworker/0:0H]
    6 root         0 SW   [kworker/u2:0]
    7 root         0 SW   [rcu_preempt]
    8 root         0 SW   [rcu_sched]
    9 root         0 SW   [rcu_bh]
   10 root         0 SW<  [lru-add-drain]
   11 root         0 SW   [kdevtmpfs]
   12 root         0 SW   [kworker/u2:1]
  210 root         0 SW   [oom_reaper]
  211 root         0 SW<  [writeback]
  213 root         0 SW   [kcompactd0]
  214 root         0 SW<  [crypto]
  215 root         0 SW<  [bioset]
  217 root         0 SW<  [kblockd]
  258 root         0 SW   [sys_user]
  265 root         0 SW   [kworker/0:1]
  266 root         0 SW<  [cfg80211]
  273 root         0 SW<  [watchdogd]
  287 root         0 SW<  [spi0]
  297 root         0 SW   [kswapd0]
  380 root         0 SW<  [bioset]
  385 root         0 SW<  [bioset]
  390 root         0 SW<  [bioset]
  395 root         0 SW<  [bioset]
  400 root         0 SW<  [bioset]
  405 root         0 SW<  [bioset]
  410 root         0 SW<  [bioset]
  415 root         0 SW<  [bioset]
  420 root         0 SW<  [bioset]
  448 root         0 SW   [kworker/0:2]
  449 root         0 SW   [irq/302-sunxi-m]
  451 root         0 SW   [irq/166-sdc0 cd]
  452 root         0 SW   [irq/303-sunxi-m]
  495 root         0 SW   [kworker/0:3]
  518 root         0 SW   [kworker/0:4]
  520 root         0 SW<  [bioset]
  521 root         0 SW   [mmcqd/0]
  532 root         0 SW<  [kworker/0:1H]
  545 root         0 SWN  [jffs2_gcd_mtd4]
  550 root       980 S    -/bin/sh
  583 root       980 S    /usr/sbin/telnetd
  596 root         0 SW<  [phy0-atbm_wq]
  597 root         0 SW   [phy0-usb_atbm_b]
  641 root      1164 S    ./dispatch
  644 root       992 S    sh /tmp/sd/yi-hack/script/system.sh
 1238 root         0 SW   [kworker/u2:2]
 1290 root      1468 S    /backup/tools/wpa_supplicant -c/tmp/wpa_supplicant.c
 1297 root         0 SW   [kworker/u2:3]
 1334 root      1048 S    udhcpc -i wlan0 -b -s /backup/tools/default.script -
 1425 root       980 S    sh -c /home/app/cloudAPI -c 136 -url http://api.eu.x
 1426 root       980 S    {cloudAPI} /bin/sh /home/app/cloudAPI -c 136 -url ht
 1430 root       984 S    {cloudAPI_fake} /bin/sh /tmp/sd/yi-hack/bin/cloudAPI
 1437 root       860 S    {ntpd} /tmp/sd/yi-hack/bin/busybox /tmp/sd/yi-hack/u
 1665 root       884 S    ./cloud
 1666 root       980 R    ps
 1668 root       980 S    sh -c /home/app/cloudAPI -c 136 -url https://api.eu.
[FREE]
              total        used        free      shared  buff/cache   available
Mem:          60912       10392       37548         172       12972       49324
Swap:             0           0           0

Starting http
Starting sshd
Starting ntp
Starting mqtt services
Starting rtsp
Starting crontab
Starting custom startup.sh
system.sh completed
[PS]
  PID USER       VSZ STAT COMMAND
    1 root       980 S    /sbin/init
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    4 root         0 SW   [kworker/0:0]
    5 root         0 SW<  [kworker/0:0H]
    6 root         0 SW   [kworker/u2:0]
    7 root         0 SW   [rcu_preempt]
    8 root         0 SW   [rcu_sched]
    9 root         0 SW   [rcu_bh]
   10 root         0 SW<  [lru-add-drain]
   11 root         0 SW   [kdevtmpfs]
   12 root         0 SW   [kworker/u2:1]
  210 root         0 SW   [oom_reaper]
  211 root         0 SW<  [writeback]
  213 root         0 SW   [kcompactd0]
  214 root         0 SW<  [crypto]
  215 root         0 SW<  [bioset]
  217 root         0 SW<  [kblockd]
  258 root         0 SW   [sys_user]
  265 root         0 SW   [kworker/0:1]
  266 root         0 SW<  [cfg80211]
  273 root         0 SW<  [watchdogd]
  287 root         0 SW<  [spi0]
  297 root         0 SW   [kswapd0]
  380 root         0 SW<  [bioset]
  385 root         0 SW<  [bioset]
  390 root         0 SW<  [bioset]
  395 root         0 SW<  [bioset]
  400 root         0 SW<  [bioset]
  405 root         0 SW<  [bioset]
  410 root         0 SW<  [bioset]
  415 root         0 SW<  [bioset]
  420 root         0 SW<  [bioset]
  448 root         0 SW   [kworker/0:2]
  449 root         0 SW   [irq/302-sunxi-m]
  451 root         0 SW   [irq/166-sdc0 cd]
  452 root         0 SW   [irq/303-sunxi-m]
  495 root         0 SW   [kworker/0:3]
  518 root         0 SW   [kworker/0:4]
  520 root         0 SW<  [bioset]
  521 root         0 SW   [mmcqd/0]
  532 root         0 SW<  [kworker/0:1H]
  545 root         0 SWN  [jffs2_gcd_mtd4]
  550 root       980 S    -/bin/sh
  583 root       980 S    /usr/sbin/telnetd
  596 root         0 SW<  [phy0-atbm_wq]
  597 root         0 SW   [phy0-usb_atbm_b]
  641 root      1164 S    ./dispatch
  644 root       996 S    sh /tmp/sd/yi-hack/script/system.sh
 1238 root         0 SW   [kworker/u2:2]
 1290 root      1468 S    /backup/tools/wpa_supplicant -c/tmp/wpa_supplicant.c
 1297 root         0 SW   [kworker/u2:3]
 1334 root      1048 S    udhcpc -i wlan0 -b -s /backup/tools/default.script -
 1665 root       884 S    ./cloud
 1668 root       980 S    sh -c /home/app/cloudAPI -c 136 -url https://api.eu.
 1669 root       980 S    {cloudAPI} /bin/sh /home/app/cloudAPI -c 136 -url ht
 1677 root       984 S    {cloudAPI_fake} /bin/sh /tmp/sd/yi-hack/bin/cloudAPI
 1689 root       860 S    {ntpd} /tmp/sd/yi-hack/bin/busybox /tmp/sd/yi-hack/u
 1693 root       860 S    {httpd} /tmp/sd/yi-hack/bin/busybox /tmp/sd/yi-hack/
 1710 root       868 S    /tmp/sd/yi-hack/bin/dropbearmulti /tmp/sd/yi-hack/sb
 1712 root       880 S    mqttv4
 1743 root       860 S    {ntpd} /tmp/sd/yi-hack/bin/busybox /tmp/sd/yi-hack/u
 1768 root      4060 S<   rRTSPServer -m y211ga -r high -a ulaw -p 554 -u admi
 1769 root       996 S    {wd_rtsp.sh} /bin/sh /tmp/sd/yi-hack/script/wd_rtsp.
 1825 root       860 S    {crond} /tmp/sd/yi-hack/bin/busybox /tmp/sd/yi-hack/
 1860 root       996 S    {wd_rtsp.sh} /bin/sh /tmp/sd/yi-hack/script/wd_rtsp.
 1861 root       996 S    top -b -n 2 -d 1
 1862 root       980 S    grep rRTSPServer
 1863 root       980 S    grep -v grep
 1864 root       860 S    {tail} /tmp/sd/yi-hack/bin/busybox /tmp/sd/yi-hack/u
 1865 root       980 S    awk {print $8}
 2151 root       980 R    ps
[FREE]
              total        used        free      shared  buff/cache   available
Mem:          60912       11240       36024         188       13648       48460
Swap:             0           0           0

########
1970-01-01-00:06:31
Starting system.sh
Make /etc writable
Setting username and password
Configuring cloudAPI
Starting yi processes
[PS]
  PID USER       VSZ STAT COMMAND
    1 root       980 S    /sbin/init
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    4 root         0 SW   [kworker/0:0]
    5 root         0 SW<  [kworker/0:0H]
    6 root         0 SW   [kworker/u2:0]
    7 root         0 SW   [rcu_preempt]
    8 root         0 SW   [rcu_sched]
    9 root         0 SW   [rcu_bh]
   10 root         0 SW<  [lru-add-drain]
   11 root         0 SW   [kdevtmpfs]
   12 root         0 SW   [kworker/u2:1]
  210 root         0 SW   [oom_reaper]
  211 root         0 SW<  [writeback]
  213 root         0 SW   [kcompactd0]
  214 root         0 SW<  [crypto]
  215 root         0 SW<  [bioset]
  217 root         0 SW<  [kblockd]
  258 root         0 SW   [sys_user]
  265 root         0 SW   [kworker/0:1]
  266 root         0 SW<  [cfg80211]
  272 root         0 SW<  [watchdogd]
  287 root         0 SW<  [spi0]
  297 root         0 SW   [kswapd0]
  380 root         0 SW<  [bioset]
  385 root         0 SW<  [bioset]
  390 root         0 SW<  [bioset]
  395 root         0 SW<  [bioset]
  400 root         0 SW<  [bioset]
  405 root         0 SW<  [bioset]
  410 root         0 SW<  [bioset]
  415 root         0 SW<  [bioset]
  420 root         0 SW<  [bioset]
  448 root         0 SW   [kworker/0:2]
  449 root         0 SW   [irq/302-sunxi-m]
  451 root         0 SW   [irq/166-sdc0 cd]
  452 root         0 SW   [irq/303-sunxi-m]
  495 root         0 SW   [kworker/0:3]
  518 root         0 SW   [kworker/0:4]
  520 root         0 SW<  [bioset]
  521 root         0 SW   [mmcqd/0]
  532 root         0 SW<  [kworker/0:1H]
  545 root         0 SWN  [jffs2_gcd_mtd4]
  550 root       980 S    -/bin/sh
  573 root         0 SW   [kworker/u2:2]
  584 root       980 S    /usr/sbin/telnetd
  597 root         0 SW<  [phy0-atbm_wq]
  598 root         0 SW   [phy0-usb_atbm_b]
  642 root       812 D    ./dispatch
  645 root       988 S    sh /tmp/sd/yi-hack/script/system.sh
 1204 root       980 R    ps
[FREE]
              total        used        free      shared  buff/cache   available
Mem:          60912        9196       46108          68        5608       50612
Swap:             0           0           0

Changing /etc/hosts
Starting blacklist
Touch RTSP
Touch Speaker
Starting rmm
Sleep 6
dd audio_fifo 8192
Start buffer
Start cloud
Yi processes started successfully
[PS]
  PID USER       VSZ STAT COMMAND
    1 root       980 S    /sbin/init
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    4 root         0 SW   [kworker/0:0]
    5 root         0 SW<  [kworker/0:0H]
    6 root         0 SW   [kworker/u2:0]
    7 root         0 SW   [rcu_preempt]
    8 root         0 SW   [rcu_sched]
    9 root         0 SW   [rcu_bh]
   10 root         0 SW<  [lru-add-drain]
   11 root         0 SW   [kdevtmpfs]
   12 root         0 SW   [kworker/u2:1]
  210 root         0 SW   [oom_reaper]
  211 root         0 SW<  [writeback]
  213 root         0 SW   [kcompactd0]
  214 root         0 SW<  [crypto]
  215 root         0 SW<  [bioset]
  217 root         0 SW<  [kblockd]
  258 root         0 SW   [sys_user]
  265 root         0 SW   [kworker/0:1]
  266 root         0 SW<  [cfg80211]
  272 root         0 SW<  [watchdogd]
  287 root         0 SW<  [spi0]
  297 root         0 SW   [kswapd0]
  380 root         0 SW<  [bioset]
  385 root         0 SW<  [bioset]
  390 root         0 SW<  [bioset]
  395 root         0 SW<  [bioset]
  400 root         0 SW<  [bioset]
  405 root         0 SW<  [bioset]
  410 root         0 SW<  [bioset]
  415 root         0 SW<  [bioset]
  420 root         0 SW<  [bioset]
  448 root         0 SW   [kworker/0:2]
  449 root         0 SW   [irq/302-sunxi-m]
  451 root         0 SW   [irq/166-sdc0 cd]
  452 root         0 SW   [irq/303-sunxi-m]
  495 root         0 SW   [kworker/0:3]
  518 root         0 SW   [kworker/0:4]
  520 root         0 SW<  [bioset]
  521 root         0 SW   [mmcqd/0]
  532 root         0 SW<  [kworker/0:1H]
  545 root         0 SWN  [jffs2_gcd_mtd4]
  550 root       980 S    -/bin/sh
  573 root         0 SW   [kworker/u2:2]
  584 root       980 S    /usr/sbin/telnetd
  597 root         0 SW<  [phy0-atbm_wq]
  598 root         0 SW   [phy0-usb_atbm_b]
  642 root      1164 S    ./dispatch
  645 root       992 S    sh /tmp/sd/yi-hack/script/system.sh
 1290 root      1488 S    /backup/tools/wpa_supplicant -c/tmp/wpa_supplicant.c
 1297 root         0 SW   [kworker/u2:3]
 1334 root      1048 S    udhcpc -i wlan0 -b -s /backup/tools/default.script -
 1719 root       884 S    ./cloud
 1720 root       980 R    ps
 1722 root       980 S    sh -c /home/app/cloudAPI -c 136 -url https://api.eu.
[FREE]
              total        used        free      shared  buff/cache   available
Mem:          60912       10120       37760         176       13032       49592
Swap:             0           0           0

Starting http
Starting sshd
Starting ntp
Starting mqtt services
Starting rtsp
Starting crontab
Starting custom startup.sh
system.sh completed
[PS]
  PID USER       VSZ STAT COMMAND
    1 root       980 S    /sbin/init
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    4 root         0 SW   [kworker/0:0]
    5 root         0 SW<  [kworker/0:0H]
    6 root         0 SW   [kworker/u2:0]
    7 root         0 SW   [rcu_preempt]
    8 root         0 SW   [rcu_sched]
    9 root         0 SW   [rcu_bh]
   10 root         0 SW<  [lru-add-drain]
   11 root         0 SW   [kdevtmpfs]
   12 root         0 SW   [kworker/u2:1]
  210 root         0 SW   [oom_reaper]
  211 root         0 SW<  [writeback]
  213 root         0 SW   [kcompactd0]
  214 root         0 SW<  [crypto]
  215 root         0 SW<  [bioset]
  217 root         0 SW<  [kblockd]
  258 root         0 SW   [sys_user]
  265 root         0 SW   [kworker/0:1]
  266 root         0 SW<  [cfg80211]
  272 root         0 SW<  [watchdogd]
  287 root         0 SW<  [spi0]
  297 root         0 SW   [kswapd0]
  380 root         0 SW<  [bioset]
  385 root         0 SW<  [bioset]
  390 root         0 SW<  [bioset]
  395 root         0 SW<  [bioset]
  400 root         0 SW<  [bioset]
  405 root         0 SW<  [bioset]
  410 root         0 SW<  [bioset]
  415 root         0 SW<  [bioset]
  420 root         0 SW<  [bioset]
  448 root         0 SW   [kworker/0:2]
  449 root         0 SW   [irq/302-sunxi-m]
  451 root         0 SW   [irq/166-sdc0 cd]
  452 root         0 SW   [irq/303-sunxi-m]
  495 root         0 SW   [kworker/0:3]
  518 root         0 SW   [kworker/0:4]
  520 root         0 SW<  [bioset]
  521 root         0 SW   [mmcqd/0]
  532 root         0 SW<  [kworker/0:1H]
  545 root         0 SWN  [jffs2_gcd_mtd4]
  550 root       980 S    -/bin/sh
  573 root         0 SW   [kworker/u2:2]
  584 root       980 S    /usr/sbin/telnetd
  597 root         0 SW<  [phy0-atbm_wq]
  598 root         0 SW   [phy0-usb_atbm_b]
  642 root      1164 S    ./dispatch
  645 root       996 S    sh /tmp/sd/yi-hack/script/system.sh
 1290 root      1488 S    /backup/tools/wpa_supplicant -c/tmp/wpa_supplicant.c
 1297 root         0 SW   [kworker/u2:3]
 1334 root      1048 S    udhcpc -i wlan0 -b -s /backup/tools/default.script -
 1719 root       884 S    ./cloud
 1722 root       980 S    sh -c /home/app/cloudAPI -c 136 -url https://api.eu.
 1723 root       980 S    {cloudAPI} /bin/sh /home/app/cloudAPI -c 136 -url ht
 1731 root       984 S    {cloudAPI_fake} /bin/sh /tmp/sd/yi-hack/bin/cloudAPI
 1743 root       860 S    {ntpd} /tmp/sd/yi-hack/bin/busybox /tmp/sd/yi-hack/u
 1747 root       860 S    {httpd} /tmp/sd/yi-hack/bin/busybox /tmp/sd/yi-hack/
 1768 root       868 S    /tmp/sd/yi-hack/bin/dropbearmulti /tmp/sd/yi-hack/sb
 1770 root       880 S    mqttv4
 1797 root       860 S    {ntpd} /tmp/sd/yi-hack/bin/busybox /tmp/sd/yi-hack/u
 1825 root      4060 S<   rRTSPServer -m y211ga -r high -a ulaw -p 554 -u admi
 1826 root       996 S    {wd_rtsp.sh} /bin/sh /tmp/sd/yi-hack/script/wd_rtsp.
 1878 root       860 S    {crond} /tmp/sd/yi-hack/bin/busybox /tmp/sd/yi-hack/
 1916 root       996 S    {wd_rtsp.sh} /bin/sh /tmp/sd/yi-hack/script/wd_rtsp.
 1919 root       996 S    top -b -n 2 -d 1
 1920 root       980 S    grep rRTSPServer
 1921 root       980 S    grep -v grep
 1922 root       860 S    {tail} /tmp/sd/yi-hack/bin/busybox /tmp/sd/yi-hack/u
 1923 root       980 S    awk {print $8}
 2204 root       980 R    ps
[FREE]
              total        used        free      shared  buff/cache   available
Mem:          60912       11276       35916         192       13720       48420
Swap:             0           0           0

########
1970-01-01-00:07:09
Starting system.sh
Make /etc writable
Setting username and password
Configuring cloudAPI
Starting yi processes
[PS]
  PID USER       VSZ STAT COMMAND
    1 root       980 S    /sbin/init
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    4 root         0 SW   [kworker/0:0]
    5 root         0 SW<  [kworker/0:0H]
    6 root         0 SW   [kworker/u2:0]
    7 root         0 SW   [rcu_preempt]
    8 root         0 SW   [rcu_sched]
    9 root         0 SW   [rcu_bh]
   10 root         0 SW<  [lru-add-drain]
   11 root         0 SW   [kdevtmpfs]
   12 root         0 SW   [kworker/u2:1]
  210 root         0 SW   [oom_reaper]
  211 root         0 SW<  [writeback]
  213 root         0 SW   [kcompactd0]
  214 root         0 SW<  [crypto]
  215 root         0 SW<  [bioset]
  217 root         0 SW<  [kblockd]
  258 root         0 SW   [sys_user]
  265 root         0 SW   [kworker/0:1]
  266 root         0 SW<  [cfg80211]
  272 root         0 SW<  [watchdogd]
  287 root         0 SW<  [spi0]
  297 root         0 SW   [kswapd0]
  380 root         0 SW<  [bioset]
  385 root         0 SW<  [bioset]
  390 root         0 SW<  [bioset]
  395 root         0 SW<  [bioset]
  400 root         0 SW<  [bioset]
  405 root         0 SW<  [bioset]
  410 root         0 SW<  [bioset]
  415 root         0 SW<  [bioset]
  420 root         0 SW<  [bioset]
  448 root         0 SW   [kworker/0:2]
  449 root         0 SW   [irq/302-sunxi-m]
  451 root         0 SW   [irq/166-sdc0 cd]
  452 root         0 SW   [irq/303-sunxi-m]
  495 root         0 SW   [kworker/0:3]
  518 root         0 SW   [kworker/0:4]
  520 root         0 SW<  [bioset]
  522 root         0 SW   [mmcqd/0]
  532 root         0 SW<  [kworker/0:1H]
  545 root         0 SWN  [jffs2_gcd_mtd4]
  550 root       980 S    -/bin/sh
  573 root         0 SW   [kworker/u2:2]
  584 root       980 S    /usr/sbin/telnetd
  597 root         0 SW<  [phy0-atbm_wq]
  598 root         0 SW   [phy0-usb_atbm_b]
  642 root       812 D    ./dispatch
  645 root       988 S    sh /tmp/sd/yi-hack/script/system.sh
 1204 root       980 R    ps
[FREE]
              total        used        free      shared  buff/cache   available
Mem:          60912        9204       46100          68        5608       50604
Swap:             0           0           0

Changing /etc/hosts
Starting blacklist
Touch RTSP
Touch Speaker
Starting rmm
Sleep 6
dd audio_fifo 8192
Start buffer
Start cloud
Yi processes started successfully
[PS]
  PID USER       VSZ STAT COMMAND
    1 root       980 S    /sbin/init
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    4 root         0 SW   [kworker/0:0]
    5 root         0 SW<  [kworker/0:0H]
    6 root         0 SW   [kworker/u2:0]
    7 root         0 SW   [rcu_preempt]
    8 root         0 SW   [rcu_sched]
    9 root         0 SW   [rcu_bh]
   10 root         0 SW<  [lru-add-drain]
   11 root         0 SW   [kdevtmpfs]
   12 root         0 SW   [kworker/u2:1]
  210 root         0 SW   [oom_reaper]
  211 root         0 SW<  [writeback]
  213 root         0 SW   [kcompactd0]
  214 root         0 SW<  [crypto]
  215 root         0 SW<  [bioset]
  217 root         0 SW<  [kblockd]
  258 root         0 SW   [sys_user]
  265 root         0 SW   [kworker/0:1]
  266 root         0 SW<  [cfg80211]
  272 root         0 SW<  [watchdogd]
  287 root         0 SW<  [spi0]
  297 root         0 SW   [kswapd0]
  380 root         0 SW<  [bioset]
  385 root         0 SW<  [bioset]
  390 root         0 SW<  [bioset]
  395 root         0 SW<  [bioset]
  400 root         0 SW<  [bioset]
  405 root         0 SW<  [bioset]
  410 root         0 SW<  [bioset]
  415 root         0 SW<  [bioset]
  420 root         0 SW<  [bioset]
  448 root         0 SW   [kworker/0:2]
  449 root         0 SW   [irq/302-sunxi-m]
  451 root         0 SW   [irq/166-sdc0 cd]
  452 root         0 SW   [irq/303-sunxi-m]
  495 root         0 SW   [kworker/0:3]
  518 root         0 SW   [kworker/0:4]
  520 root         0 SW<  [bioset]
  522 root         0 SW   [mmcqd/0]
  532 root         0 SW<  [kworker/0:1H]
  545 root         0 SWN  [jffs2_gcd_mtd4]
  550 root       980 S    -/bin/sh
  573 root         0 SW   [kworker/u2:2]
  584 root       980 S    /usr/sbin/telnetd
  597 root         0 SW<  [phy0-atbm_wq]
  598 root         0 SW   [phy0-usb_atbm_b]
  642 root      1164 S    ./dispatch
  645 root       992 S    sh /tmp/sd/yi-hack/script/system.sh
 1235 root     40696 S    ./rmm
 1317 root      1488 S    /backup/tools/wpa_supplicant -c/tmp/wpa_supplicant.c
 1364 root      1048 S    udhcpc -i wlan0 -b -s /backup/tools/default.script -
 1680 root       884 S    ./cloud
 1681 root       980 R    ps
 1683 root       980 S    sh -c /home/app/cloudAPI -c 136 -url https://api.eu.
[FREE]
              total        used        free      shared  buff/cache   available
Mem:          60912       38180        9088         216       13644       21492
Swap:             0           0           0

Starting http
Starting sshd
Starting ntp
Starting mqtt services
Starting rtsp
Starting crontab
Starting custom startup.sh
system.sh completed
[PS]
  PID USER       VSZ STAT COMMAND
    1 root       980 S    /sbin/init
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    4 root         0 SW   [kworker/0:0]
    5 root         0 SW<  [kworker/0:0H]
    6 root         0 SW   [kworker/u2:0]
    7 root         0 SW   [rcu_preempt]
    8 root         0 SW   [rcu_sched]
    9 root         0 SW   [rcu_bh]
   10 root         0 SW<  [lru-add-drain]
   11 root         0 SW   [kdevtmpfs]
   12 root         0 SW   [kworker/u2:1]
  210 root         0 SW   [oom_reaper]
  211 root         0 SW<  [writeback]
  213 root         0 SW   [kcompactd0]
  214 root         0 SW<  [crypto]
  215 root         0 SW<  [bioset]
  217 root         0 SW<  [kblockd]
  258 root         0 SW   [sys_user]
  265 root         0 SW   [kworker/0:1]
  266 root         0 SW<  [cfg80211]
  272 root         0 SW<  [watchdogd]
  287 root         0 SW<  [spi0]
  297 root         0 SW   [kswapd0]
  380 root         0 SW<  [bioset]
  385 root         0 SW<  [bioset]
  390 root         0 SW<  [bioset]
  395 root         0 SW<  [bioset]
  400 root         0 SW<  [bioset]
  405 root         0 SW<  [bioset]
  410 root         0 SW<  [bioset]
  415 root         0 SW<  [bioset]
  420 root         0 SW<  [bioset]
  448 root         0 SW   [kworker/0:2]
  449 root         0 SW   [irq/302-sunxi-m]
  451 root         0 SW   [irq/166-sdc0 cd]
  452 root         0 SW   [irq/303-sunxi-m]
  495 root         0 SW   [kworker/0:3]
  518 root         0 SW   [kworker/0:4]
  520 root         0 SW<  [bioset]
  522 root         0 SW   [mmcqd/0]
  532 root         0 SW<  [kworker/0:1H]
  545 root         0 SWN  [jffs2_gcd_mtd4]
  550 root       980 S    -/bin/sh
  573 root         0 SW   [kworker/u2:2]
  584 root       980 S    /usr/sbin/telnetd
  597 root         0 SW<  [phy0-atbm_wq]
  598 root         0 SW   [phy0-usb_atbm_b]
  642 root      1164 S    ./dispatch
  645 root       996 S    sh /tmp/sd/yi-hack/script/system.sh
 1235 root     40696 S    ./rmm
 1317 root      1488 S    /backup/tools/wpa_supplicant -c/tmp/wpa_supplicant.c
 1364 root      1048 S    udhcpc -i wlan0 -b -s /backup/tools/default.script -
 1680 root       884 S    ./cloud
 1683 root       980 S    sh -c /home/app/cloudAPI -c 136 -url https://api.eu.
 1684 root       980 S    {cloudAPI} /bin/sh /home/app/cloudAPI -c 136 -url ht
 1692 root       984 S    {cloudAPI_fake} /bin/sh /tmp/sd/yi-hack/bin/cloudAPI
 1705 root       860 S    {ntpd} /tmp/sd/yi-hack/bin/busybox /tmp/sd/yi-hack/u
 1708 root       860 S    {httpd} /tmp/sd/yi-hack/bin/busybox /tmp/sd/yi-hack/
 1724 root       868 S    /tmp/sd/yi-hack/bin/dropbearmulti /tmp/sd/yi-hack/sb
 1727 root       880 S    mqttv4
 1757 root       860 S    {ntpd} /tmp/sd/yi-hack/bin/busybox /tmp/sd/yi-hack/u
 1783 root       996 S    {wd_rtsp.sh} /bin/sh /tmp/sd/yi-hack/script/wd_rtsp.
 1837 root       860 S    {crond} /tmp/sd/yi-hack/bin/busybox /tmp/sd/yi-hack/
 2113 root       980 S    sleep 1
 2168 root       980 R    ps
[FREE]
              total        used        free      shared  buff/cache   available
Mem:          60912       38796        7376         644       14740       20448

If I'm not wrong the log shows 3 boot procedures (2 reboots).
Probably the problem is rmm: this process didn't start in the first 2 boot procedures; only during the 3rd.
What happens if you remove the sd card? Does the cam start properly?

If I'm not wrong the log shows 3 boot procedures (2 reboots).

Correct, I lost count.

What happens if you remove the sd card? Does the cam start properly?

The camera starts fine, no reboot. I can't check with the official application as I don't have my tablet right now.

If I'm not wrong the log shows 3 boot procedures (2 reboots). Probably the problem is rmm: this process didn't start in the first 2 boot procedures; only during the 3rd.

Any idea how to debug it? Can we redirect the output (if any) ?

Just reboot it and again, and only 1 reboot by itself this time. It seems it gets stuck after dd audio_fifo 8192:
...
  550 root       980 S    -/bin/sh
  573 root         0 SW   [kworker/u2:2]
  584 root       980 S    /usr/sbin/telnetd
  597 root         0 SW<  [phy0-atbm_wq]
  598 root         0 SW   [phy0-usb_atbm_b]
  642 root       812 D    ./dispatch
  645 root       988 S    sh /tmp/sd/yi-hack/script/system.sh
 1204 root       980 R    ps
[FREE]
              total        used        free      shared  buff/cache   available
Mem:          60912        9196       46108          68        5608       50612
Swap:             0           0           0

Changing /etc/hosts
Starting blacklist
Touch RTSP
Touch Speaker
Starting rmm
Sleep 6
dd audio_fifo 8192

And indeed, manual attempts never end:
root@camera-3:~# dd if=/tmp/audio_fifo of=/dev/null bs=1 count=8192
^C
root@camera-3:~# dd if=/dev/zero of=/tmp/audio_in_fifo bs=1 count=1024 (the commented one)
^C

I don't know if it's related to the main issue but maybe a hint?
And again, activating swap solves the problem. Maybe another hint?

A couple of test, please:

read the file /tmp/sd/lower_half_init.sh and check if system.sh is called 2 times

root@yi-hack-h52ga:~# cat /tmp/sd/lower_half_init.sh | grep system.sh
chmod 755 /tmp/sd/yi-hack/script/system.sh
sh /tmp/sd/yi-hack/script/system.sh &

Just reboot it and again, and only 1 reboot by itself this time. It seems it gets stuck after dd audio_fifo 8192:

This is normal if rmm doesn't start. I could find a better solution but at the moment...

And again, activating swap solves the problem. Maybe another hint?

Is this true? Regardless of this issue swap is needed if you want to use some features like snapshots.
But if this is true the problem is a memory issue. What's causing a memory issue?
Probably something related to snapshots or something related to the 1st step: system.sh called 2 times.
About /etc/init.d/S02app stop, this is normal if the cam is rebooting. This is the script executed by the cam when it's closing all processes before the shutdown.
We are close to the solution.

Read the file /tmp/sd/lower_half_init.sh and check if system.sh is called 2 times
root@yi-hack-h52ga:~# cat /tmp/sd/lower_half_init.sh | grep system.sh
chmod 755 /tmp/sd/yi-hack/script/system.sh
sh /tmp/sd/yi-hack/script/system.sh &

It is not:
root@camera-3:/tmp/sd# cat /tmp/sd/lower_half_init.sh | grep system.sh
chmod 755 /tmp/sd/yi-hack/script/system.sh
sh /tmp/sd/yi-hack/script/system.sh &
root@camera-3:/tmp/sd#

This is normal if rmm doesn't start. I could find a better solution but at the moment...

I mean, it's actually as this very command: dd if=/tmp/audio_fifo of=/dev/null bs=1 count=8192, not after (I log just before the actual command).

Is this true? Regardless of this issue swap is needed if you want to use some features like snapshots.
But if this is true the problem is a memory issue. What's causing a memory issue?
Probably something related to snapshots or something related to the 1st step: system.sh called 2 times.

At least that's what I noticed in my tests. And IIRC, it was also the case with a fresh install (no settings or whatever) but maybe swap is enabled by default? And why lower_half_init.sh would be called twice? Which process starts it?

We are close to the solution.

Even if I have a workaround, I definitely hope so!
Thanks for your help!

The boot sequence is:

init (linux init)
/etc/init.d/rcS
/etc/init.d/S01udev
/etc/init.d/S02app
/backup/init.sh
/tmp/sd/lower_half_init.sh (if SD is present)
/home/app/lower_half_init.sh (if SD is not present)

Read the file /backup/init.sh and check lower_half_init.sh start.
cat /backup/init.sh | grep lower
But I studied the shell script and, as far as I understand, the system.sh repeated (in ps output) is not a problem.
When it runs other shells and binaries it creates a "subshell". So it's not running 2 or 3 times.

Edit 2:
Interestingly, if I manually start system.sh when 2 of them are already running, dd finally works and everything runs smoothly > (almost)

The problem that dd blocks the script is that the fifo /tmp/audio_fifo is not filled by rmm and the read is blocking.
So, probably when the 2 second instance of the script starts rmm, it unlocks the fifo and dd starts.

Edit 3:
I accidentally prevented system.sh to run and manually starting it makes everything to work. Maybe this script is called to early in the init process?

Maybe, I will study a couple of sleep to add to the script.

Hi @roleoroleo !
Just wanted to let you know that even with your fix on 0.2.7, the issue still appears when I disable the SWAP.
I definitely need to find some time to investigate that again.
Let me know if you have any clue or if I can test anything.
Thanks!


Automatic ID/name lookup and resource cross-referencing features

I think one of the most useful things to have in a tool like this is an interface that makes references to other bridge resources easy to recognize and identify at a glance as well as making it convenient to insert resource references during editing, without having to manually remember or look up raw IDs.
I'm imagining it could be something like this:

IDs or references (whether in API path form, such as “/<resource-type>/<ID>/…”, or as raw IDs) could have the human-friendly name assigned to that resource shown next to it in the GUI for easy identification. If the resource/ID isn't actually found on the bridge, there could be an indication like “ID/resource not found” or a similar string where the name would appear, maybe with a small yellow-exclamation-warning type icon or similar

Hovering the mouse over the name could show a pop-up listing other interesting attributes/values of the resource at a glance, and clicking it could navigate directly to that resource in the main view. (A web-browser-like back/forward function for returning back to the original spot again might also be useful if this sort of hyperlinking is implemented.)

When entering an ID or resource, there could be a pop-up menu or similar mechanism available for selecting appropriate choices. This would show resource names next to their IDs so it's easy to find the desired one and have its ID/path automatically pasted in when selected.

For recognizing resources/IDs in the datastore for cross-referencing purposes, I've used an algorithm like this:
if node name is “lightstates”:
    assume names of child nodes are light IDs
if node name is “address”:
    assume value is resource path
if node name is “scene”:
    assume value is scene ID
if node value is a list of strings:
    if node name is “lights”, assume list of light IDs
    if node name is “links”, assume list of resource paths

 Trace a node by clicking address in another node (and open in new tab)


Nothing happens after submitting Spotify credentials

Nothing is happening after I specify  my username number and device password.
The log just says "Google Login success" and then nothing. The js console is blank, too. Chrome's network tab shows a POST request with my credentials pending, but the response doesn't come back. After a while there's "Failed to load resource: net::ERR_EMPTY_RESPONSE" log in js console.
Portify 0.5.1
Node 0.10.28 x64
Windows 8.1

Unfortunately either this still does not work, or it is broken again.
I use Facebook to log into Spotify, so I set a password on my account page and used that. I updated the function using the fix provided by @A-Gochnio, and unfortunately when I look in the Chrome Network debugger tab, the XHR request to http://localhost:3132/spotify/login just sits there and says status "(pending)."